Skip to content

Commit

Permalink
Lock v8 Isolate while pumping message loop
Browse files Browse the repository at this point in the history
Not sure when this became required. Docs do say
> The caller has to make sure that this is called from the right thread.
but make no mention of required locking.
  • Loading branch information
Fayti1703 committed Jun 1, 2023
1 parent 5663f5a commit 1e43a49
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ext/mini_racer_extension/mini_racer_extension.cc
Original file line number Diff line number Diff line change
Expand Up @@ -977,6 +977,8 @@ static VALUE rb_isolate_pump_message_loop(VALUE self) {

if (current_platform == NULL) return Qfalse;

Locker guard { isolate_info->isolate };

if (platform::PumpMessageLoop(current_platform.get(), isolate_info->isolate)){
return Qtrue;
} else {
Expand Down

0 comments on commit 1e43a49

Please sign in to comment.