]> granicus.if.org Git - libevent/commitdiff
test/regress: fix bufferevent_pair_release_lock with EVENT_DEBUG_MODE
authorAzat Khuzhin <a3at.mail@gmail.com>
Wed, 2 Sep 2015 08:55:14 +0000 (11:55 +0300)
committerAzat Khuzhin <a3at.mail@gmail.com>
Wed, 2 Sep 2015 16:37:00 +0000 (19:37 +0300)
Before this patch you will see next error:
$ EVENT_DEBUG_MODE= regress --no-fork bufferevent/bufferevent_pair_release_lock
bufferevent/bufferevent_pair_release_lock: [err] evthread initialization must be called BEFORE anything else!

test/regress_bufferevent.c

index a87e02ed3d3fcad82cca31884567fb8c0cc17500..731db9c8673dd293372cd108896cdef90a56580e 100644 (file)
@@ -278,6 +278,9 @@ static void lock_unlock_free_thread_cbs(void)
 {
        event_base_free(NULL);
 
+       if (libevent_tests_running_in_debug_mode)
+               libevent_global_shutdown();
+
        /** drop immutable flag */
        evthread_set_lock_callbacks(NULL);
        /** avoid calling of event_global_setup_locks_() for new cbs */