threads: fix WAIT_SYNC_INIT with a zero count
WAIT_SYNC_INIT(sync,0); WAIT_SYNC_RELEASE(sync); hanged because sync->signaled was initialised to true, and there is no reason to invoke WAIT_SYNC_SIGNALED(sync) before WAIT_SYNC_RELEASE(sync) this commit initializes sync->signaled to true unless the count is zero. Thanks George for the review and guidance.
Этот коммит содержится в:
родитель
08d08e6c69
Коммит
44a66e208c
@ -6,6 +6,8 @@
|
||||
* Copyright (c) 2016 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2016 Mellanox Technologies. All rights reserved.
|
||||
* Copyright (c) 2016 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -86,11 +88,11 @@ static inline int sync_wait_st (ompi_wait_sync_t *sync)
|
||||
|
||||
#define WAIT_SYNC_INIT(sync,c) \
|
||||
do { \
|
||||
(sync)->count = c; \
|
||||
(sync)->count = (c); \
|
||||
(sync)->next = NULL; \
|
||||
(sync)->prev = NULL; \
|
||||
(sync)->status = 0; \
|
||||
(sync)->signaling = true; \
|
||||
(sync)->signaling = (0 != (c)); \
|
||||
if (opal_using_threads()) { \
|
||||
pthread_cond_init (&(sync)->condition, NULL); \
|
||||
pthread_mutex_init (&(sync)->lock, NULL); \
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user