diff options
| author | Narayan Kamath <narayan@google.com> | 2017-09-13 12:53:52 +0100 |
|---|---|---|
| committer | Narayan Kamath <narayan@google.com> | 2017-09-13 14:18:03 +0100 |
| commit | fc74cb45eafe51162b10a850016c6d2e1f8fd23c (patch) | |
| tree | 203fb0f2feed47099e5bf999bcaff954f5c0e49d /evthread_pthread.c | |
| parent | 9dfd4017adef7eaf179f743bf746254917a4fb74 (diff) | |
| download | platform_external_libevent-fc74cb45eafe51162b10a850016c6d2e1f8fd23c.tar.gz platform_external_libevent-fc74cb45eafe51162b10a850016c6d2e1f8fd23c.tar.bz2 platform_external_libevent-fc74cb45eafe51162b10a850016c6d2e1f8fd23c.zip | |
Revert "Revert "Upgrade to 2.1.8-stable (2017-01-22)." and "Probably Mac build fix?""
This reverts commit 83a0c9c65a60a92d3ea5542596b3ba56db492c37.
Bug: 64543673
Test: make checkbuild
Test: Manual tombstoned test
Change-Id: I84bb128d1dec433195f2cbdbf70236ba17fa9955
Diffstat (limited to 'evthread_pthread.c')
| -rw-r--r-- | evthread_pthread.c | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/evthread_pthread.c b/evthread_pthread.c index c4d06ea..4e11f74 100644 --- a/evthread_pthread.c +++ b/evthread_pthread.c @@ -24,9 +24,11 @@ * 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 this to get PTHREAD_MUTEX_RECURSIVE. */ -#define _GNU_SOURCE +/* With glibc we need to define _GNU_SOURCE to get PTHREAD_MUTEX_RECURSIVE. + * This comes from evconfig-private.h + */ #include <pthread.h> struct event_base; @@ -56,17 +58,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 @@ -74,9 +76,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); } @@ -85,13 +87,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(); @@ -112,17 +114,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); @@ -132,11 +134,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; |
