projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3516bdf
)
Lock the state change on exiting a thread.
author
Dave West
<davew@uncensored.citadel.org>
Fri, 30 Nov 2007 17:59:07 +0000
(17:59 +0000)
committer
Dave West
<davew@uncensored.citadel.org>
Fri, 30 Nov 2007 17:59:07 +0000
(17:59 +0000)
citadel/sysdep.c
patch
|
blob
|
history
diff --git
a/citadel/sysdep.c
b/citadel/sysdep.c
index 5358fb3d403c4e93ffb515211d8819c984af74e6..918b11aa26e4e80d77ba310d6ca8c388d3d946d0 100644
(file)
--- a/
citadel/sysdep.c
+++ b/
citadel/sysdep.c
@@
-1442,7
+1442,9
@@
static void ctdl_internal_thread_cleanup(void *arg)
#ifdef HAVE_BACKTRACE
eCrash_UnregisterThread();
#endif
+ pthread_mutex_lock(&this_thread->ThreadMutex);
this_thread->state = CTDL_THREAD_EXITED; // needs to be last thing else house keeping will unlink us too early
+ pthread_mutex_unlock(&this_thread->ThreadMutex);
end_critical_section(S_THREAD_LIST);
// CtdlThreadGC();
}