Skip to content

Commit 969c367

Browse files
committed
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. Refs: libuv#2003 (comment)
1 parent 341e052 commit 969c367

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

include/uv/unix.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ typedef pthread_cond_t uv_cond_t;
134134
typedef pthread_key_t uv_key_t;
135135

136136
/* Note: guard clauses should match uv_barrier_init's in src/unix/thread.c. */
137-
#if !defined(PTHREAD_BARRIER_SERIAL_THREAD)
137+
#if defined(_AIX) || !defined(PTHREAD_BARRIER_SERIAL_THREAD)
138138
/* TODO(bnoordhuis) Merge into uv_barrier_t in v2. */
139139
struct _uv_barrier {
140140
uv_mutex_t mutex;

src/unix/thread.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ STATIC_ASSERT(sizeof(uv_barrier_t) == sizeof(pthread_barrier_t));
4949
#endif
5050

5151
/* Note: guard clauses should match uv_barrier_t's in include/uv/uv-unix.h. */
52-
#if !defined(PTHREAD_BARRIER_SERIAL_THREAD)
52+
#if defined(_AIX) || !defined(PTHREAD_BARRIER_SERIAL_THREAD)
5353
int uv_barrier_init(uv_barrier_t* barrier, unsigned int count) {
5454
struct _uv_barrier* b;
5555
int rc;

0 commit comments

Comments
 (0)