diff options
author | Sverker Eriksson <[email protected]> | 2015-06-29 15:24:00 +0200 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2015-06-29 15:24:00 +0200 |
commit | 3f95bd6b63d4ee585fc3dcc53cd0f214e33762b3 (patch) | |
tree | 0a84fb38f2ce7ff1f428fe6edd6aede5089d9727 /erts/emulator/sys/common/erl_poll.c | |
parent | 74a95b3d511177a9b35c2b0272b9ca5511b6f750 (diff) | |
parent | 99d3e9c5b2569169d2f5fefd67898d2533e5a83d (diff) | |
download | otp-3f95bd6b63d4ee585fc3dcc53cd0f214e33762b3.tar.gz otp-3f95bd6b63d4ee585fc3dcc53cd0f214e33762b3.tar.bz2 otp-3f95bd6b63d4ee585fc3dcc53cd0f214e33762b3.zip |
Merge branch 'maint-17' into maint
Conflicts:
OTP_VERSION
erts/doc/src/notes.xml
erts/vsn.mk
otp_versions.table
Diffstat (limited to 'erts/emulator/sys/common/erl_poll.c')
-rw-r--r-- | erts/emulator/sys/common/erl_poll.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/erts/emulator/sys/common/erl_poll.c b/erts/emulator/sys/common/erl_poll.c index 884c403da4..21fa214364 100644 --- a/erts/emulator/sys/common/erl_poll.c +++ b/erts/emulator/sys/common/erl_poll.c @@ -431,7 +431,7 @@ static ERTS_INLINE int is_interrupted_reset(ErtsPollSet ps) { #if defined(USE_THREADS) || ERTS_POLL_ASYNC_INTERRUPT_SUPPORT - return (erts_atomic32_xchg_nob(&ps->wakeup_state, ERTS_POLL_NOT_WOKEN) + return (erts_atomic32_xchg_acqb(&ps->wakeup_state, ERTS_POLL_NOT_WOKEN) == ERTS_POLL_WOKEN_INTR); #else return 0; @@ -442,7 +442,7 @@ static ERTS_INLINE void woke_up(ErtsPollSet ps) { #if defined(USE_THREADS) || ERTS_POLL_ASYNC_INTERRUPT_SUPPORT - erts_aint32_t wakeup_state = erts_atomic32_read_nob(&ps->wakeup_state); + erts_aint32_t wakeup_state = erts_atomic32_read_acqb(&ps->wakeup_state); if (wakeup_state == ERTS_POLL_NOT_WOKEN) (void) erts_atomic32_cmpxchg_nob(&ps->wakeup_state, ERTS_POLL_WOKEN, @@ -469,14 +469,9 @@ wake_poller(ErtsPollSet ps, int interrupted, int async_signal_safe) wakeup_state = erts_atomic32_cmpxchg_relb(&ps->wakeup_state, ERTS_POLL_WOKEN, ERTS_POLL_NOT_WOKEN); - else { - /* - * We might unnecessarily write to the pipe, however, - * that isn't problematic. - */ - wakeup_state = erts_atomic32_read_nob(&ps->wakeup_state); - erts_atomic32_set_relb(&ps->wakeup_state, ERTS_POLL_WOKEN_INTR); - } + else + wakeup_state = erts_atomic32_xchg_relb(&ps->wakeup_state, + ERTS_POLL_WOKEN_INTR); wake = wakeup_state == ERTS_POLL_NOT_WOKEN; } /* |