Index: src/debug.cc |
diff --git a/src/debug.cc b/src/debug.cc |
index 04f8a7a0274eeaec9d401bc436aad178a182739f..a4f9197311dac5c30d2ea4d79b087f6415a41627 100644 |
--- a/src/debug.cc |
+++ b/src/debug.cc |
@@ -2605,7 +2605,6 @@ Debugger::Debugger(Isolate* isolate) |
message_handler_(NULL), |
debugger_unload_pending_(false), |
host_dispatch_handler_(NULL), |
- dispatch_handler_access_(OS::CreateMutex()), |
debug_message_dispatch_handler_(NULL), |
message_dispatch_helper_thread_(NULL), |
host_dispatch_micros_(100 * 1000), |
@@ -2618,8 +2617,6 @@ Debugger::Debugger(Isolate* isolate) |
Debugger::~Debugger() { |
- delete dispatch_handler_access_; |
- dispatch_handler_access_ = 0; |
delete command_received_; |
command_received_ = 0; |
} |
@@ -3302,7 +3299,7 @@ void Debugger::SetHostDispatchHandler(v8::Debug::HostDispatchHandler handler, |
void Debugger::SetDebugMessageDispatchHandler( |
v8::Debug::DebugMessageDispatchHandler handler, bool provide_locker) { |
- ScopedLock with(dispatch_handler_access_); |
+ ScopedLock with(&dispatch_handler_access_); |
debug_message_dispatch_handler_ = handler; |
if (provide_locker && message_dispatch_helper_thread_ == NULL) { |
@@ -3345,7 +3342,7 @@ void Debugger::ProcessCommand(Vector<const uint16_t> command, |
MessageDispatchHelperThread* dispatch_thread; |
{ |
- ScopedLock with(dispatch_handler_access_); |
+ ScopedLock with(&dispatch_handler_access_); |
dispatch_thread = message_dispatch_helper_thread_; |
} |
@@ -3465,7 +3462,7 @@ void Debugger::WaitForAgent() { |
void Debugger::CallMessageDispatchHandler() { |
v8::Debug::DebugMessageDispatchHandler handler; |
{ |
- ScopedLock with(dispatch_handler_access_); |
+ ScopedLock with(&dispatch_handler_access_); |
handler = Debugger::debug_message_dispatch_handler_; |
} |
if (handler != NULL) { |
@@ -3786,24 +3783,20 @@ void CommandMessageQueue::Expand() { |
LockingCommandMessageQueue::LockingCommandMessageQueue(Logger* logger, int size) |
- : logger_(logger), queue_(size) { |
- lock_ = OS::CreateMutex(); |
-} |
+ : logger_(logger), queue_(size) {} |
-LockingCommandMessageQueue::~LockingCommandMessageQueue() { |
- delete lock_; |
-} |
+LockingCommandMessageQueue::~LockingCommandMessageQueue() {} |
-bool LockingCommandMessageQueue::IsEmpty() const { |
- ScopedLock sl(lock_); |
+bool LockingCommandMessageQueue::IsEmpty() { |
+ ScopedLock sl(&lock_); |
return queue_.IsEmpty(); |
} |
CommandMessage LockingCommandMessageQueue::Get() { |
- ScopedLock sl(lock_); |
+ ScopedLock sl(&lock_); |
CommandMessage result = queue_.Get(); |
logger_->DebugEvent("Get", result.text()); |
return result; |
@@ -3811,14 +3804,14 @@ CommandMessage LockingCommandMessageQueue::Get() { |
void LockingCommandMessageQueue::Put(const CommandMessage& message) { |
- ScopedLock sl(lock_); |
+ ScopedLock sl(&lock_); |
queue_.Put(message); |
logger_->DebugEvent("Put", message.text()); |
} |
void LockingCommandMessageQueue::Clear() { |
- ScopedLock sl(lock_); |
+ ScopedLock sl(&lock_); |
queue_.Clear(); |
} |
@@ -3826,19 +3819,17 @@ void LockingCommandMessageQueue::Clear() { |
MessageDispatchHelperThread::MessageDispatchHelperThread(Isolate* isolate) |
: Thread("v8:MsgDispHelpr"), |
isolate_(isolate), sem_(OS::CreateSemaphore(0)), |
- mutex_(OS::CreateMutex()), already_signalled_(false) { |
-} |
+ already_signalled_(false) {} |
MessageDispatchHelperThread::~MessageDispatchHelperThread() { |
- delete mutex_; |
delete sem_; |
} |
void MessageDispatchHelperThread::Schedule() { |
{ |
- ScopedLock lock(mutex_); |
+ ScopedLock lock(&mutex_); |
if (already_signalled_) { |
return; |
} |
@@ -3852,7 +3843,7 @@ void MessageDispatchHelperThread::Run() { |
while (true) { |
sem_->Wait(); |
{ |
- ScopedLock lock(mutex_); |
+ ScopedLock lock(&mutex_); |
already_signalled_ = false; |
} |
{ |