You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(locker): make Locker a pure mutex, add IsolateScope for Enter/Exit
V8's Isolate::Enter()/Exit() manage a per-isolate entry_stack_ that
stores the "previous isolate" at each nesting level. When multiple
Lockers coexist on the same thread (cooperative scheduling via
spawn_local), non-LIFO drop ordering causes Exit() to restore a stale
pointer, leading to a NULL dereference on the next Enter().
Fix: Locker now acquires only the V8 mutex (pure mutex). It temporarily
enters the isolate during construction so the C++ Locker sees
IsCurrent()==true and sets top_level_=false, then immediately exits.
The new IsolateScope type manages Enter/Exit at fine-grained boundaries
around each synchronous V8 work block, ensuring proper nesting.
API change: callers must now call locker.enter() to get an IsolateScope
before performing V8 operations. Existing tests updated accordingly.