Using v8 in a multi-threaded environment requires explicit calls to enter and exit the context.
This patch adds support for asking context to switch to explicit enter/exit pairs (default is still to implicitly Enter the context)
In addition, this patch introduces the context::context_scope class which is an RAII to Enter and Exit the context. When the isolate is owned by the context, in addition to enter the context, it also acquires a v8::Locker and enters the Isolate.
This means that by acquiring a context_scope you can safely call JS from any thread.
Using v8 in a multi-threaded environment requires explicit calls to enter and exit the context. This patch adds support for asking context to switch to explicit enter/exit pairs (default is still to implicitly Enter the context)
In addition, this patch introduces the context::context_scope class which is an RAII to Enter and Exit the context. When the isolate is owned by the context, in addition to enter the context, it also acquires a v8::Locker and enters the Isolate.
This means that by acquiring a context_scope you can safely call JS from any thread.