diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/thread.c | 4 | ||||
| -rw-r--r-- | src/thread_posix.c | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/thread.c b/src/thread.c index 9620085..645dd0b 100644 --- a/src/thread.c +++ b/src/thread.c @@ -209,10 +209,10 @@ void bh_thread_pool_worker(void *arg) task->flags |= BH_THREAD_DONE; if (task->flags & BH_THREAD_CLEANUP) bh_task_free(task); - + bh_mutex_lock(&pool->lock); pool->active--; - + bh_mutex_unlock(&pool->lock); bh_cond_broadcast(&pool->done_task); } diff --git a/src/thread_posix.c b/src/thread_posix.c index a20bd57..2ed3ab8 100644 --- a/src/thread_posix.c +++ b/src/thread_posix.c @@ -13,7 +13,7 @@ static void *bh_thread_run(void *arg) if (task->flags & BH_THREAD_CLEANUP) bh_task_free(task); - + return NULL; } @@ -119,7 +119,7 @@ int bh_thread_pool_init(bh_thread_pool_t *pool, if (bh_cond_init(&pool->new_task)) goto task_fail; - + if (bh_cond_init(&pool->done_task)) goto done_fail; @@ -134,7 +134,7 @@ int bh_thread_pool_init(bh_thread_pool_t *pool, bh_queue_init(&pool->tasks); if (bh_queue_reserve(&pool->tasks, 64)) goto queue_fail; - + /* Initialize threads */ for (i = 0; i < size; i++) { @@ -149,7 +149,7 @@ int bh_thread_pool_init(bh_thread_pool_t *pool, goto queue_fail; } } - + return 0; queue_fail: |
