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:
1ee637d
)
securing total_threads with the mutex while destroying the processor
author
Tobias Brunner
<tobias@strongswan.org>
Wed, 2 Apr 2008 15:28:08 +0000
(15:28 -0000)
committer
Tobias Brunner
<tobias@strongswan.org>
Wed, 2 Apr 2008 15:28:08 +0000
(15:28 -0000)
src/charon/processing/processor.c
patch
|
blob
|
history
diff --git
a/src/charon/processing/processor.c
b/src/charon/processing/processor.c
index
bfae7bd
..
e14679b
100644
(file)
--- a/
src/charon/processing/processor.c
+++ b/
src/charon/processing/processor.c
@@
-193,11
+193,13
@@
static void set_threads(private_processor_t *this, u_int count)
static void destroy(private_processor_t *this)
{
set_threads(this, 0);
+ pthread_mutex_lock(&this->mutex);
while (this->total_threads > 0)
{
pthread_cond_broadcast(&this->condvar);
pthread_cond_wait(&this->condvar, &this->mutex);
}
+ pthread_mutex_unlock(&this->mutex);
this->list->destroy_offset(this->list, offsetof(job_t, destroy));
free(this);
}