diff options
| -rw-r--r-- | thread_sync.c | 6 | ||||
| -rw-r--r-- | version.h | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/thread_sync.c b/thread_sync.c index 8964e24a5f..f775d44451 100644 --- a/thread_sync.c +++ b/thread_sync.c @@ -289,14 +289,18 @@ do_mutex_lock(VALUE self, int interruptible_p) th->status = prev_status; } th->vm->sleeper--; - if (mutex->th == th) mutex_locked(th, self); if (interruptible_p) { + /* release mutex before checking for interrupts...as interrupt checking + * code might call rb_raise() */ + if (mutex->th == th) mutex->th = 0; RUBY_VM_CHECK_INTS_BLOCKING(th->ec); /* may release mutex */ if (!mutex->th) { mutex->th = th; mutex_locked(th, self); } + } else { + if (mutex->th == th) mutex_locked(th, self); } } } @@ -1,6 +1,6 @@ #define RUBY_VERSION "2.5.6" #define RUBY_RELEASE_DATE "2019-08-27" -#define RUBY_PATCHLEVEL 182 +#define RUBY_PATCHLEVEL 183 #define RUBY_RELEASE_YEAR 2019 #define RUBY_RELEASE_MONTH 8 |
