mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-10 13:04:23 -04:00
Make event_base_getnpriorities work with old "implicit base" code
This commit is contained in:
parent
bd395549a3
commit
c46cb9c3a2
3
event.c
3
event.c
@ -1129,6 +1129,9 @@ event_base_get_npriorities(struct event_base *base)
|
|||||||
{
|
{
|
||||||
|
|
||||||
int n;
|
int n;
|
||||||
|
if (base == NULL)
|
||||||
|
base = current_base;
|
||||||
|
|
||||||
EVBASE_ACQUIRE_LOCK(base, th_base_lock);
|
EVBASE_ACQUIRE_LOCK(base, th_base_lock);
|
||||||
n = base->nactivequeues;
|
n = base->nactivequeues;
|
||||||
EVBASE_RELEASE_LOCK(base, th_base_lock);
|
EVBASE_RELEASE_LOCK(base, th_base_lock);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user