From a3a601c5da8a8e3cef5a9ef992c72d5dd0e2970b Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Mon, 8 Oct 2018 11:14:41 +0200 Subject: [PATCH] aix: switch to libuv's own thread barrier impl It was pointed out that pthread_barrier_wait() behaves slightly different from other platforms. Switch to libuv's own thread barrier for uniformity of behavior. Perhaps we'll do that for more platforms in the future. PR-URL: https://github.com/libuv/libuv/pull/2019 Refs: https://github.com/libuv/libuv/pull/2003#issuecomment-426471646 Reviewed-By: Santiago Gimeno --- include/uv/unix.h | 2 +- src/unix/thread.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/uv/unix.h b/include/uv/unix.h index b53d3ad4..7208557b 100644 --- a/include/uv/unix.h +++ b/include/uv/unix.h @@ -134,7 +134,7 @@ typedef pthread_cond_t uv_cond_t; typedef pthread_key_t uv_key_t; /* Note: guard clauses should match uv_barrier_init's in src/unix/thread.c. */ -#if !defined(PTHREAD_BARRIER_SERIAL_THREAD) +#if defined(_AIX) || !defined(PTHREAD_BARRIER_SERIAL_THREAD) /* TODO(bnoordhuis) Merge into uv_barrier_t in v2. */ struct _uv_barrier { uv_mutex_t mutex; diff --git a/src/unix/thread.c b/src/unix/thread.c index 667ad268..ab8988ef 100644 --- a/src/unix/thread.c +++ b/src/unix/thread.c @@ -49,7 +49,7 @@ STATIC_ASSERT(sizeof(uv_barrier_t) == sizeof(pthread_barrier_t)); #endif /* Note: guard clauses should match uv_barrier_t's in include/uv/uv-unix.h. */ -#if !defined(PTHREAD_BARRIER_SERIAL_THREAD) +#if defined(_AIX) || !defined(PTHREAD_BARRIER_SERIAL_THREAD) int uv_barrier_init(uv_barrier_t* barrier, unsigned int count) { struct _uv_barrier* b; int rc;