Skip to content

Commit

Permalink
pool: fix ABTI_pool_pop_timedwait
Browse files Browse the repository at this point in the history
ABTI_pool_pop_timedwait() does not properly handle ABT_UNIT_NULL.  This
patch adds a branch to deal with ABT_UNIT_NULL.
  • Loading branch information
shintaro-iwasaki committed Aug 23, 2021
1 parent d1cd706 commit e630885
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/pool/pool.c
Original file line number Diff line number Diff line change
Expand Up @@ -1444,11 +1444,15 @@ ABT_thread ABTI_pool_pop_timedwait(ABTI_pool *p_pool, double abstime_secs)
ABT_unit unit =
p_pool->deprecated_def.p_pop_timedwait(ABTI_pool_get_handle(p_pool),
abstime_secs);
ABTI_thread *p_thread =
ABTI_unit_get_thread(ABTI_global_get_global(), unit);
ABT_thread thread = ABTI_thread_get_handle(p_thread);
LOG_DEBUG_POOL_POP(p_pool, thread);
return thread;
if (unit == ABT_UNIT_NULL) {
return ABT_THREAD_NULL;
} else {
ABTI_thread *p_thread =
ABTI_unit_get_thread(ABTI_global_get_global(), unit);
ABT_thread thread = ABTI_thread_get_handle(p_thread);
LOG_DEBUG_POOL_POP(p_pool, thread);
return thread;
}
}

void ABTI_pool_print(ABTI_pool *p_pool, FILE *p_os, int indent)
Expand Down

0 comments on commit e630885

Please sign in to comment.