]> granicus.if.org Git - libevent/commitdiff
Make event_base_getnpriorities work with old "implicit base" code
authorNick Mathewson <nickm@torproject.org>
Wed, 9 May 2012 14:49:28 +0000 (10:49 -0400)
committerNick Mathewson <nickm@torproject.org>
Wed, 9 May 2012 16:06:00 +0000 (12:06 -0400)
event.c

diff --git a/event.c b/event.c
index 3bc16babf1372e998016a6bbd886d2842f74f415..616ad9dab4851bac085213f218707afc1ef24fd3 100644 (file)
--- a/event.c
+++ b/event.c
@@ -1129,6 +1129,9 @@ event_base_get_npriorities(struct event_base *base)
 {
 
        int n;
+       if (base == NULL)
+               base = current_base;
+
        EVBASE_ACQUIRE_LOCK(base, th_base_lock);
        n = base->nactivequeues;
        EVBASE_RELEASE_LOCK(base, th_base_lock);