diff options
author | Rickard Green <rickard@erlang.org> | 2011-05-10 20:43:11 +0200 |
---|---|---|
committer | Rickard Green <rickard@erlang.org> | 2011-05-13 14:23:20 +0200 |
commit | 425e282be62f8205b1ba262b112f38688b421c49 (patch) | |
tree | 7aee86f0d249330f02b84440771f066e0973b272 | |
parent | 673f5d1bf684f15ac5526d8a21552eca9a0c9052 (diff) | |
download | otp-425e282be62f8205b1ba262b112f38688b421c49.tar.gz otp-425e282be62f8205b1ba262b112f38688b421c49.tar.bz2 otp-425e282be62f8205b1ba262b112f38688b421c49.zip |
Ensure quick break
Make sure that we don't have to wait in poll before break
handling is done.
-rw-r--r-- | erts/emulator/sys/common/erl_check_io.c | 5 | ||||
-rw-r--r-- | erts/emulator/sys/win32/erl_poll.c | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/erts/emulator/sys/common/erl_check_io.c b/erts/emulator/sys/common/erl_check_io.c index 218bd79584..71b374527e 100644 --- a/erts/emulator/sys/common/erl_check_io.c +++ b/erts/emulator/sys/common/erl_check_io.c @@ -1137,6 +1137,11 @@ ERTS_CIO_EXPORT(erts_check_io)(int do_wait) restart: +#ifdef ERTS_BREAK_REQUESTED + if (ERTS_BREAK_REQUESTED) + erts_do_break_handling(); +#endif + /* Figure out timeout value */ if (do_wait) { erts_time_remaining(&wait_time); diff --git a/erts/emulator/sys/win32/erl_poll.c b/erts/emulator/sys/win32/erl_poll.c index 7662f190ef..074e2e247f 100644 --- a/erts/emulator/sys/win32/erl_poll.c +++ b/erts/emulator/sys/win32/erl_poll.c @@ -693,6 +693,7 @@ static void *break_waiter(void *param) ResetEvent(harr[0]); erts_mtx_lock(&break_waiter_lock); erts_atomic32_set(&break_waiter_state,BREAK_WAITER_GOT_BREAK); + ERTS_THR_MEMORY_BARRIER; SetEvent(break_happened_event); erts_mtx_unlock(&break_waiter_lock); break; @@ -700,6 +701,7 @@ static void *break_waiter(void *param) ResetEvent(harr[1]); erts_mtx_lock(&break_waiter_lock); erts_atomic32_set(&break_waiter_state,BREAK_WAITER_GOT_HALT); + ERTS_THR_MEMORY_BARRIER; SetEvent(break_happened_event); erts_mtx_unlock(&break_waiter_lock); break; |