summaryrefslogtreecommitdiff
path: root/thread_sync.c
diff options
context:
space:
mode:
authorLuke Gruber <luke.gruber@shopify.com>2026-01-27 12:36:55 -0500
committerGitHub <noreply@github.com>2026-01-27 12:36:55 -0500
commit52e71ad4b766d57236e66ebbc419a4447fb0b491 (patch)
tree22d1544e7ddc3018f3682d1a198a34dc81045c01 /thread_sync.c
parent5d769228c1055524205437860beb1fc2de2d11a0 (diff)
Fix test for mutex starvation as well as small fix in thread_sync.c (#15982)
Don't reset `th->running_time_us` when unlocking from `mutex_free` or force unlocking during thread destruction. Follow-up to 994257ab06072d.
Diffstat (limited to 'thread_sync.c')
-rw-r--r--thread_sync.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/thread_sync.c b/thread_sync.c
index 2963b6db73..8b86c90380 100644
--- a/thread_sync.c
+++ b/thread_sync.c
@@ -466,7 +466,7 @@ rb_mutex_unlock_th(rb_mutex_t *mutex, rb_thread_t *th, rb_serial_t ec_serial)
struct sync_waiter *cur = 0, *next;
- if (mutex->wait_waking) {
+ if (mutex->wait_waking && ec_serial) {
uint32_t saved = mutex->saved_running_time_us;
if (th->running_time_us < saved) {
th->running_time_us = saved;