diff options
author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2015-04-07 08:29:34 +0000 |
---|---|---|
committer | <> | 2015-04-13 18:52:43 +0000 |
commit | b2ccf8dd31d1457ae9f0ae270054117179220370 (patch) | |
tree | 4ccd4a16d5e9ef5869630ba624e822665a6e248c /sntp/libevent/evthread.c | |
parent | bdab5265fcbf3f472545073a23f8999749a9f2b9 (diff) | |
download | ntp-b2ccf8dd31d1457ae9f0ae270054117179220370.tar.gz |
Imported from /home/lorry/working-area/delta_ntp/ntp-4.2.8p2.tar.gz.HEADntp-4.2.8p2master
Diffstat (limited to 'sntp/libevent/evthread.c')
-rw-r--r-- | sntp/libevent/evthread.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/sntp/libevent/evthread.c b/sntp/libevent/evthread.c index 4da5d24..02dab7a 100644 --- a/sntp/libevent/evthread.c +++ b/sntp/libevent/evthread.c @@ -69,12 +69,25 @@ evthread_set_id_callback(unsigned long (*id_fn)(void)) evthread_id_fn_ = id_fn; } +struct evthread_lock_callbacks *evthread_get_lock_callbacks() +{ + return evthread_lock_debugging_enabled_ + ? &original_lock_fns_ : &evthread_lock_fns_; +} +struct evthread_condition_callbacks *evthread_get_condition_callbacks() +{ + return evthread_lock_debugging_enabled_ + ? &original_cond_fns_ : &evthread_cond_fns_; +} +void evthreadimpl_disable_lock_debugging_(void) +{ + evthread_lock_debugging_enabled_ = 0; +} + int evthread_set_lock_callbacks(const struct evthread_lock_callbacks *cbs) { - struct evthread_lock_callbacks *target = - evthread_lock_debugging_enabled_ - ? &original_lock_fns_ : &evthread_lock_fns_; + struct evthread_lock_callbacks *target = evthread_get_lock_callbacks(); if (!cbs) { if (target->alloc) @@ -109,9 +122,7 @@ evthread_set_lock_callbacks(const struct evthread_lock_callbacks *cbs) int evthread_set_condition_callbacks(const struct evthread_condition_callbacks *cbs) { - struct evthread_condition_callbacks *target = - evthread_lock_debugging_enabled_ - ? &original_cond_fns_ : &evthread_cond_fns_; + struct evthread_condition_callbacks *target = evthread_get_condition_callbacks(); if (!cbs) { if (target->alloc_condition) |