--- old/src/hotspot/os/linux/waitBarrier_linux.cpp 2018-12-18 11:15:42.032283584 +0100 +++ new/src/hotspot/os/linux/waitBarrier_linux.cpp 2018-12-18 11:15:41.709271971 +0100 @@ -38,10 +38,9 @@ #define guarantee_with_errno(cond, msg) check_with_errno(guarantee, cond, msg) -static int futex(volatile int *uaddr, int futex_op, int val, - const struct timespec *timeout, int *uaddr2, int val3) +static int futex(volatile int *addr, int futex_op, int op_arg) { - return syscall(SYS_futex, uaddr, futex_op, val, timeout, uaddr2, val3); + return syscall(SYS_futex, addr, futex_op, op_arg, NULL, NULL, 0); } void LinuxWaitBarrier::arm(int barrier_tag) { @@ -59,11 +58,8 @@ void LinuxWaitBarrier::wake() { assert(_futex_barrier == 0, "Not disarmed"); int s = futex(&_futex_barrier, - FUTEX_WAKE, - INT_MAX, /* wake a max of this many threads */ - NULL /* ignored */, - NULL /* ignored */, - 0 /* ignored */); + FUTEX_WAKE_PRIVATE, + INT_MAX /* wake a max of this many threads */); guarantee_with_errno(s > -1, "futex FUTEX_WAKE"); } @@ -76,18 +72,14 @@ } do { int s = futex(&_futex_barrier, - FUTEX_WAIT, - barrier_tag, /* should be this tag */ - NULL, /* no timeout */ - NULL, /* ignored */ - 0 /* ignored */); + FUTEX_WAIT_PRIVATE, + barrier_tag /* should be this tag */); guarantee_with_errno((s == 0) || (s == -1 && errno == EAGAIN) || (s == -1 && errno == EINTR), "futex FUTEX_WAIT"); - // Return value 0, re-check in case of spurious wake-up. - // EINTR and re-check and go back to waiting. - // EAGAIN we already are disarmed, we should pass the check, - // if not re-armed with same tag. + // Return value 0: woken up, but re-check in case of spurious wakeup + // Error EINTR: woken by signal, so re-check and re-wait if necessary. + // Error EAGAIN: we are already disarmed and so will pass the check } while (barrier_tag == _futex_barrier); }