summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--thread_pthread.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/thread_pthread.c b/thread_pthread.c
index 38bc134fa8..9f6707ae5d 100644
--- a/thread_pthread.c
+++ b/thread_pthread.c
@@ -1055,14 +1055,12 @@ ubf_set(rb_thread_t *th, rb_unblock_function_t *func, void *arg)
static void
ubf_clear(rb_thread_t *th)
{
- if (th->unblock.func) {
- rb_native_mutex_lock(&th->interrupt_lock);
- {
- th->unblock.func = NULL;
- th->unblock.arg = NULL;
- }
- rb_native_mutex_unlock(&th->interrupt_lock);
+ rb_native_mutex_lock(&th->interrupt_lock);
+ {
+ th->unblock.func = NULL;
+ th->unblock.arg = NULL;
}
+ rb_native_mutex_unlock(&th->interrupt_lock);
}
static void