summaryrefslogtreecommitdiff
path: root/mjit.c
diff options
context:
space:
mode:
authork0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-26 15:47:20 +0000
committerk0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-26 15:47:20 +0000
commit67485fee42677b712a2ff002726f83f49b945564 (patch)
tree5015b79d3ceec3991b106d2963b971eb1db0fe34 /mjit.c
parent01e2bf35bc893a4c2331fd77ec43d275bbc8a0aa (diff)
vm_trace.c: MJIT-limited thread-safety for postponed_job
[Bug #15316] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66001 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'mjit.c')
-rw-r--r--mjit.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/mjit.c b/mjit.c
index 7c8eb28481..cb84d3cd32 100644
--- a/mjit.c
+++ b/mjit.c
@@ -106,6 +106,20 @@ mjit_gc_finish_hook(void)
CRITICAL_SECTION_FINISH(4, "mjit_gc_finish_hook");
}
+/* Wrap critical section to prevent [Bug #15316] */
+void
+mjit_postponed_job_register_start_hook(void)
+{
+ CRITICAL_SECTION_START(4, "mjit_postponed_job_register_start_hook");
+}
+
+/* Unwrap critical section of mjit_postponed_job_register_start_hook() */
+void
+mjit_postponed_job_register_finish_hook(void)
+{
+ CRITICAL_SECTION_FINISH(4, "mjit_postponed_job_register_finish_hook");
+}
+
/* Iseqs can be garbage collected. This function should call when it
happens. It removes iseq from the unit. */
void