FS-10167: Added test_thread_pools to windows build, added BREAK condition to wait for objects to be added to the queue before the workers prematurely exit. Fixed a bug in thread pool creation that wasn't showing up under linux test.

This commit is contained in:
Shane Bryldt committed 2017-03-28 19:18:56 -06:00
1 parent f023bf592d
commit af2f257dc7
3 files changed
+213 -2

No files matched your search

+2 -2
View File
@@ -135,7 +135,7 @@ static void *worker_thread(ks_thread_t *thread, void *data)
*/
check_queue(tp, KS_FALSE);
if (status == KS_STATUS_TIMEOUT) {
if (status == KS_STATUS_TIMEOUT || status == KS_STATUS_BREAK) {
idle_sec++;
if (idle_sec >= tp->idle_sec) {
@@ -195,7 +195,7 @@ KS_DECLARE(ks_status_t) ks_thread_pool_create(ks_thread_pool_t **tp, uint32_t mi
ks_pool_open(&pool);
*tp = (ks_thread_pool_t *) ks_pool_alloc(pool, sizeof(ks_thread_t));
*tp = (ks_thread_pool_t *) ks_pool_alloc(pool, sizeof(ks_thread_pool_t));
(*tp)->min = min;
(*tp)->max = max;