strongswan.org
Wiki/Project Management
Downloads
Gitweb
projects
/
strongswan.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
257e27d
)
The mutex of a thread has to be locked when destroying it.
author
Tobias Brunner
<tobias@strongswan.org>
Thu, 29 Apr 2010 11:30:51 +0000
(13:30 +0200)
committer
Tobias Brunner
<tobias@strongswan.org>
Thu, 29 Apr 2010 11:30:51 +0000
(13:30 +0200)
src/libstrongswan/threading/thread.c
patch
|
blob
|
history
diff --git
a/src/libstrongswan/threading/thread.c
b/src/libstrongswan/threading/thread.c
index
86477a6
..
3751bb7
100644
(file)
--- a/
src/libstrongswan/threading/thread.c
+++ b/
src/libstrongswan/threading/thread.c
@@
-300,6
+300,7
@@
thread_t *thread_create(thread_main_t main, void *arg)
if (pthread_create(&this->thread_id, NULL, (void*)thread_main, this) != 0)
{
DBG1(DBG_LIB, "failed to create thread!");
+ this->mutex->lock(this->mutex);
thread_destroy(this);
return NULL;
}
@@
-433,6
+434,7
@@
void threads_init()
void threads_deinit()
{
private_thread_t *main_thread = (private_thread_t*)thread_current();
+ main_thread->mutex->lock(main_thread->mutex);
thread_destroy(main_thread);
current_thread->destroy(current_thread);
id_mutex->destroy(id_mutex);