git.cweiske.de
/
enigma2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d23552e
)
do call pthread_join before new pthread_create when the thread handle is valid
author
ghost
<andreas.monzner@multimedia-labs.de>
Mon, 11 Apr 2011 12:55:32 +0000
(14:55 +0200)
committer
ghost
<andreas.monzner@multimedia-labs.de>
Mon, 11 Apr 2011 12:55:32 +0000
(14:55 +0200)
fixes bug #749
lib/base/thread.cpp
patch
|
blob
|
history
diff --git
a/lib/base/thread.cpp
b/lib/base/thread.cpp
index fa923debe3ddf08aed24ec059b663a1b7486e071..1fda6a47a944efb23dd7e76a72cd7ba444991c0c 100644
(file)
--- a/
lib/base/thread.cpp
+++ b/
lib/base/thread.cpp
@@
-58,7
+58,12
@@
int eThread::runAsync(int prio, int policy)
pthread_attr_setschedpolicy(&attr, policy);
pthread_attr_setschedparam(&attr, &p);
}
pthread_attr_setschedpolicy(&attr, policy);
pthread_attr_setschedparam(&attr, &p);
}
-
+
+ if (the_thread) {
+ eDebug("old thread joined %d", pthread_join(the_thread, 0));
+ the_thread = 0;
+ }
+
if (pthread_create(&the_thread, &attr, wrapper, this))
{
pthread_attr_destroy(&attr);
if (pthread_create(&the_thread, &attr, wrapper, this))
{
pthread_attr_destroy(&attr);
@@
-69,7
+74,7
@@
int eThread::runAsync(int prio, int policy)
pthread_attr_destroy(&attr);
return 0;
pthread_attr_destroy(&attr);
return 0;
-}
+}
int eThread::run(int prio, int policy)
{
int eThread::run(int prio, int policy)
{