Stay on the safe side: Only one thread is allowed
to handle an event_base.
Этот коммит содержится в:
родитель
2fec570fe7
Коммит
357daa834e
@ -1566,14 +1566,16 @@ event_base_loop(struct event_base *base, int flags)
|
|||||||
* as we invoke user callbacks. */
|
* as we invoke user callbacks. */
|
||||||
EVBASE_ACQUIRE_LOCK(base, th_base_lock);
|
EVBASE_ACQUIRE_LOCK(base, th_base_lock);
|
||||||
|
|
||||||
if (base->running_loop && 0 == warn_once) {
|
if (base->running_loop) {
|
||||||
|
if (0 == warn_once) {
|
||||||
event_warnx("%s: reentrant invocation. Only one event_base_loop"
|
event_warnx("%s: reentrant invocation. Only one event_base_loop"
|
||||||
" can run on each event_base at once.", __func__);
|
" can run on each event_base at once.", __func__);
|
||||||
/********* OMPI CHANGE **********/
|
/********* OMPI CHANGE **********/
|
||||||
warn_once = 1;
|
warn_once = 1;
|
||||||
/*********/
|
/*********/
|
||||||
EVBASE_RELEASE_LOCK(base, th_base_lock);
|
}
|
||||||
return -1;
|
EVBASE_RELEASE_LOCK(base, th_base_lock);
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
base->running_loop = 1;
|
base->running_loop = 1;
|
||||||
|
Загрузка…
Ссылка в новой задаче
Block a user