v8
3.11.10(node0.8.26)
V8 is Google's open source JavaScript engine
|
#include <v8.h>
Public Member Functions | |
Locker (Isolate *isolate=NULL) | |
~Locker () | |
Static Public Member Functions | |
static void | StartPreemption (int every_n_ms) |
static void | StopPreemption () |
static bool | IsLocked (Isolate *isolate=NULL) |
static bool | IsActive () |
|
explicit |
Initialize Locker for a given Isolate. NULL means default isolate.
Definition at line 47 of file v8threads.cc.
References ASSERT, StackGuard::ClearThread(), Isolate::EnterDefaultIsolate(), V8::Initialize(), StackGuard::InitThread(), Isolate::IsDefaultIsolate(), Isolate::IsInitialized(), ThreadManager::IsLockedByCurrentThread(), ThreadManager::Lock(), NULL, ThreadManager::RestoreThread(), Isolate::stack_guard(), and Isolate::thread_manager().
~Locker | ( | ) |
Definition at line 102 of file v8threads.cc.
References ThreadManager::ArchiveThread(), ASSERT, ThreadManager::FreeThreadResources(), Isolate::IsDefaultIsolate(), ThreadManager::IsLockedByCurrentThread(), Isolate::thread_manager(), and ThreadManager::Unlock().
|
static |
Returns whether v8::Locker is being used by this V8 instance.
Definition at line 97 of file v8threads.cc.
|
static |
Returns whether or not the locker for a given isolate, or default isolate if NULL is given, is locked by the current thread.
Definition at line 88 of file v8threads.cc.
References ThreadManager::IsLockedByCurrentThread(), NULL, and Isolate::thread_manager().
Referenced by ContextSwitcher::PreemptionReceived(), LockAndUnlockDifferentIsolatesThread::Run(), LockUnlockLockThread::Run(), ContextSwitcher::StartPreemption(), ContextSwitcher::StopPreemption(), TEST(), and THREADED_TEST().
|
static |
Start preemption.
When preemption is started, a timer is fired every n milliseconds that will switch between multiple threads that are in contention for the V8 lock.
Definition at line 142 of file v8threads.cc.
References ContextSwitcher::StartPreemption().
Referenced by Isolate::Init(), Shell::RunMain(), RegExpInterruptTest::RunTest(), ApplyInterruptTest::RunTest(), RegExpStringModificationTest::RunTest(), and TEST().
|
static |
Stop preemption.
Definition at line 147 of file v8threads.cc.
References ContextSwitcher::StopPreemption().
Referenced by Shell::RunMain(), RegExpInterruptTest::RunTest(), ApplyInterruptTest::RunTest(), RegExpStringModificationTest::RunTest(), and TEST().