diff options
author | Josh Gao <jmgao@google.com> | 2017-08-10 12:30:25 -0700 |
---|---|---|
committer | Josh Gao <jmgao@google.com> | 2017-08-10 12:30:47 -0700 |
commit | 83a0c9c65a60a92d3ea5542596b3ba56db492c37 (patch) | |
tree | 64bb0c050c4db9ad9d721e05e3e199bfd02e60b0 /evthread_pthread.c | |
parent | af241a5c8c2cde0fab7d7d563276c1095b00e3b4 (diff) | |
download | libevent-83a0c9c65a60a92d3ea5542596b3ba56db492c37.tar.gz |
Revert "Upgrade to 2.1.8-stable (2017-01-22)." and "Probably Mac build fix?"android-o-iot-preview-5o-iot-preview-5
This reverts commits 2a572d125a91a4aafd3ad8ce87259fc640fa0763 and
af241a5c8c2cde0fab7d7d563276c1095b00e3b4, which break tombstoned.
Bug: http://b/64543673
Test: manual + treehugger
Diffstat (limited to 'evthread_pthread.c')
-rw-r--r-- | evthread_pthread.c | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/evthread_pthread.c b/evthread_pthread.c index 4e11f74..c4d06ea 100644 --- a/evthread_pthread.c +++ b/evthread_pthread.c @@ -24,11 +24,9 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "event2/event-config.h" -#include "evconfig-private.h" -/* With glibc we need to define _GNU_SOURCE to get PTHREAD_MUTEX_RECURSIVE. - * This comes from evconfig-private.h - */ +/* With glibc we need to define this to get PTHREAD_MUTEX_RECURSIVE. */ +#define _GNU_SOURCE #include <pthread.h> struct event_base; @@ -58,17 +56,17 @@ evthread_posix_lock_alloc(unsigned locktype) } static void -evthread_posix_lock_free(void *lock_, unsigned locktype) +evthread_posix_lock_free(void *_lock, unsigned locktype) { - pthread_mutex_t *lock = lock_; + pthread_mutex_t *lock = _lock; pthread_mutex_destroy(lock); mm_free(lock); } static int -evthread_posix_lock(unsigned mode, void *lock_) +evthread_posix_lock(unsigned mode, void *_lock) { - pthread_mutex_t *lock = lock_; + pthread_mutex_t *lock = _lock; if (mode & EVTHREAD_TRY) return pthread_mutex_trylock(lock); else @@ -76,9 +74,9 @@ evthread_posix_lock(unsigned mode, void *lock_) } static int -evthread_posix_unlock(unsigned mode, void *lock_) +evthread_posix_unlock(unsigned mode, void *_lock) { - pthread_mutex_t *lock = lock_; + pthread_mutex_t *lock = _lock; return pthread_mutex_unlock(lock); } @@ -87,13 +85,13 @@ evthread_posix_get_id(void) { union { pthread_t thr; -#if EVENT__SIZEOF_PTHREAD_T > EVENT__SIZEOF_LONG +#if _EVENT_SIZEOF_PTHREAD_T > _EVENT_SIZEOF_LONG ev_uint64_t id; #else unsigned long id; #endif } r; -#if EVENT__SIZEOF_PTHREAD_T < EVENT__SIZEOF_LONG +#if _EVENT_SIZEOF_PTHREAD_T < _EVENT_SIZEOF_LONG memset(&r, 0, sizeof(r)); #endif r.thr = pthread_self(); @@ -114,17 +112,17 @@ evthread_posix_cond_alloc(unsigned condflags) } static void -evthread_posix_cond_free(void *cond_) +evthread_posix_cond_free(void *_cond) { - pthread_cond_t *cond = cond_; + pthread_cond_t *cond = _cond; pthread_cond_destroy(cond); mm_free(cond); } static int -evthread_posix_cond_signal(void *cond_, int broadcast) +evthread_posix_cond_signal(void *_cond, int broadcast) { - pthread_cond_t *cond = cond_; + pthread_cond_t *cond = _cond; int r; if (broadcast) r = pthread_cond_broadcast(cond); @@ -134,11 +132,11 @@ evthread_posix_cond_signal(void *cond_, int broadcast) } static int -evthread_posix_cond_wait(void *cond_, void *lock_, const struct timeval *tv) +evthread_posix_cond_wait(void *_cond, void *_lock, const struct timeval *tv) { int r; - pthread_cond_t *cond = cond_; - pthread_mutex_t *lock = lock_; + pthread_cond_t *cond = _cond; + pthread_mutex_t *lock = _lock; if (tv) { struct timeval now, abstime; |