resolve locking issue
This commit was SVN r5470.
Этот коммит содержится в:
родитель
445d20ccab
Коммит
cc6eae3eb9
@ -291,7 +291,7 @@ int ompi_event_disable(void)
|
||||
if(ompi_using_threads()) {
|
||||
OMPI_THREAD_LOCK(&ompi_event_lock);
|
||||
if(ompi_event_inited > 0 && ompi_event_enabled == false) {
|
||||
OMPI_THREAD_LOCK(&ompi_event_lock);
|
||||
OMPI_THREAD_UNLOCK(&ompi_event_lock);
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
@ -321,7 +321,7 @@ int ompi_event_enable(void)
|
||||
|
||||
OMPI_THREAD_LOCK(&ompi_event_lock);
|
||||
if(ompi_event_inited > 0 && ompi_event_enabled == true) {
|
||||
OMPI_THREAD_LOCK(&ompi_event_lock);
|
||||
OMPI_THREAD_UNLOCK(&ompi_event_lock);
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -192,13 +192,9 @@ poll_dispatch(void *arg, struct timeval *tv)
|
||||
#endif
|
||||
|
||||
sec = tv->tv_sec * 1000 + tv->tv_usec / 1000;
|
||||
if(ompi_using_threads()) {
|
||||
ompi_mutex_unlock(&ompi_event_lock);
|
||||
OMPI_THREAD_UNLOCK(&ompi_event_lock);
|
||||
res = poll(pop->event_set, nfds, sec);
|
||||
ompi_mutex_lock(&ompi_event_lock);
|
||||
} else {
|
||||
res = poll(pop->event_set, nfds, sec);
|
||||
}
|
||||
OMPI_THREAD_LOCK(&ompi_event_lock);
|
||||
|
||||
#if OMPI_EVENT_USE_SIGNALS
|
||||
if (ompi_evsignal_recalc(&pop->evsigmask) == -1)
|
||||
|
@ -199,15 +199,10 @@ select_dispatch(void *arg, struct timeval *tv)
|
||||
#endif
|
||||
|
||||
/* release lock while waiting in kernel */
|
||||
if(ompi_using_threads()) {
|
||||
ompi_mutex_unlock(&ompi_event_lock);
|
||||
OMPI_THREAD_UNLOCK(&ompi_event_lock);
|
||||
res = select(sop->event_fds + 1, sop->event_readset,
|
||||
sop->event_writeset, NULL, tv);
|
||||
ompi_mutex_lock(&ompi_event_lock);
|
||||
} else {
|
||||
res = select(sop->event_fds + 1, sop->event_readset,
|
||||
sop->event_writeset, NULL, tv);
|
||||
}
|
||||
OMPI_THREAD_LOCK(&ompi_event_lock);
|
||||
|
||||
#if OMPI_EVENT_USE_SIGNALS
|
||||
if (ompi_evsignal_recalc(&sop->evsigmask) == -1)
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user