summaryrefslogtreecommitdiff
path: root/pool.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'pool.cpp')
-rwxr-xr-xpool.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/pool.cpp b/pool.cpp
index a8c1556..470ea24 100755
--- a/pool.cpp
+++ b/pool.cpp
@@ -197,6 +197,7 @@ pool::tpool_add_work( tpool_t tpool, void(*routine)(void*), void* arg ) ///
if( tpool->cur_queue_size == 0 )
{
tpool->queue_tail = tpool->queue_head = workp;
+ pthread_cond_signal( &(tpool->queue_not_empty) );
}
else
@@ -206,7 +207,6 @@ pool::tpool_add_work( tpool_t tpool, void(*routine)(void*), void* arg ) ///
}
tpool->cur_queue_size++;
- pthread_cond_signal( &(tpool->queue_not_empty) );
pthread_mutex_unlock( &(tpool->queue_lock) );
return 1;
}