Skip to content

Commit

Permalink
aix: switch to libuv's own thread barrier impl
Browse files Browse the repository at this point in the history
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: libuv#2019
Refs: libuv#2003 (comment)
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
  • Loading branch information
bnoordhuis committed Oct 8, 2018
1 parent 56702e0 commit a3a601c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/uv/unix.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/unix/thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a3a601c

Please sign in to comment.