summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-19 00:01:03 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-19 00:01:03 +0000
commit77038f9f826dbc988332c9ec4abf7dea57af1160 (patch)
tree38ce5304472dec4d2c628081e87fc18a093238e2 /thread.c
parentf6f54d776eae5e7862cc01fab4e35ff70f46c1b0 (diff)
Revert "thread_sync.c (rb_mutex_sleep): skip interrupt check before sleep"
This reverts commit 2e420b8b99db4a5b81e2deda1ca386d59ad6bcba (r64464) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/thread.c b/thread.c
index 4a34081..8254c7d 100644
--- a/thread.c
+++ b/thread.c
@@ -94,8 +94,7 @@ static ID id_locals;
enum SLEEP_FLAGS {
SLEEP_DEADLOCKABLE = 0x1,
- SLEEP_SPURIOUS_CHECK = 0x2,
- SLEEP_BEFORE_CHECK_INTS = 0x4
+ SLEEP_SPURIOUS_CHECK = 0x2
};
static void sleep_timespec(rb_thread_t *, struct timespec, unsigned int fl);
@@ -1188,9 +1187,7 @@ sleep_forever(rb_thread_t *th, unsigned int fl)
status = fl & SLEEP_DEADLOCKABLE ? THREAD_STOPPED_FOREVER : THREAD_STOPPED;
th->status = status;
- if (!(fl & SLEEP_BEFORE_CHECK_INTS)) {
- RUBY_VM_CHECK_INTS_BLOCKING(th->ec);
- }
+ RUBY_VM_CHECK_INTS_BLOCKING(th->ec);
while (th->status == status) {
if (fl & SLEEP_DEADLOCKABLE) {
th->vm->sleeper++;
@@ -1296,9 +1293,7 @@ sleep_timespec(rb_thread_t *th, struct timespec ts, unsigned int fl)
getclockofday(&end);
timespec_add(&end, &ts);
th->status = THREAD_STOPPED;
- if (!(fl & SLEEP_BEFORE_CHECK_INTS)) {
- RUBY_VM_CHECK_INTS_BLOCKING(th->ec);
- }
+ RUBY_VM_CHECK_INTS_BLOCKING(th->ec);
while (th->status == THREAD_STOPPED) {
native_sleep(th, &ts);
woke = vm_check_ints_blocking(th->ec);