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 <santiago.gimeno@gmail.com>
This commit is contained in:
Ben Noordhuis 2018-10-08 11:14:41 +02:00
parent 56702e08bf
commit a3a601c5da
2 changed files with 2 additions and 2 deletions

View File

@ -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;

View File

@ -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;