aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2020-11-25 16:14:01 +0900
committerKoichi Sasada <ko1@atdot.net>2020-11-25 16:14:01 +0900
commit7aaf6676c416e773b0b3053de2e250a73c2b2e77 (patch)
tree956fd649aad4c5dfff67186209fc5b802e5695f8
parentd43d4acf2638ed50ab1542769c5d032c1aa8fb31 (diff)
downloadruby-7aaf6676c416e773b0b3053de2e250a73c2b2e77.tar.gz
should stop other ractors on transient_heap_evacuate
transient_heap_evacuate() evacuates all living objects from theap to malloc mangaed memory. This evacuation can run in any ractors in parallel with other ractor's execution and it is danger. To stop such danger parallel execution, use rb_vm_barrier() to stop all other ractors.
-rw-r--r--transient_heap.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/transient_heap.c b/transient_heap.c
index 501876d704..357e4a4656 100644
--- a/transient_heap.c
+++ b/transient_heap.c
@@ -776,6 +776,7 @@ static void
transient_heap_evacuate(void *dmy)
{
RB_VM_LOCK_ENTER();
+ rb_vm_barrier();
{
struct transient_heap* theap = transient_heap_get();