summaryrefslogtreecommitdiff
path: root/mjit.c
diff options
context:
space:
mode:
authork0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-03-10 07:05:32 +0000
committerk0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-03-10 07:05:32 +0000
commite28760adfff7b516c7fd107feb4845e5cd6afece (patch)
tree1c94a02872878e764c6d39133e07af477ec9a03a /mjit.c
parente144481ed5c7f98151d63baa432ce658878fd31c (diff)
mjit.c: keep mutex unlocked on destroy
`mjit_finish` may destroy mutex even while it's still locked by `worker` by race condition. That would result in the following error: [BUG] pthread_mutex_destroy: Device or resource busy (EBUSY) Actually I couldn't get a core dump for it and reproduce it multiple times. So I'm not sure this fixes the issue which I faced or not. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62714 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'mjit.c')
-rw-r--r--mjit.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/mjit.c b/mjit.c
index 0cd2839d80..ecd3ee6c0a 100644
--- a/mjit.c
+++ b/mjit.c
@@ -926,9 +926,8 @@ worker(void)
}
}
- CRITICAL_SECTION_START(3, "in the end of worker to update worker_finished");
+ /* To keep mutex unlocked when it is destroyed by mjit_finish, don't wrap CRITICAL_SECTION here. */
worker_finished = TRUE;
- CRITICAL_SECTION_FINISH(3, "in the end of worker to update worker_finished");
}
/* MJIT info related to an existing continutaion. */