diff --git a/opal/mca/event/libevent2021/libevent/event.c b/opal/mca/event/libevent2021/libevent/event.c index 1171c81cdb..7991d8c1db 100644 --- a/opal/mca/event/libevent2021/libevent/event.c +++ b/opal/mca/event/libevent2021/libevent/event.c @@ -1566,14 +1566,16 @@ event_base_loop(struct event_base *base, int flags) * as we invoke user callbacks. */ 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" " can run on each event_base at once.", __func__); /********* OMPI CHANGE **********/ 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;