Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(214)

Side by Side Diff: src/d8-debug.cc

Issue 23625003: Cleanup Mutex and related classes. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/d8-debug.h ('k') | src/debug.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 241
242 void RemoteDebugger::ConnectionClosed() { 242 void RemoteDebugger::ConnectionClosed() {
243 RemoteDebuggerEvent* event = 243 RemoteDebuggerEvent* event =
244 new RemoteDebuggerEvent(RemoteDebuggerEvent::kDisconnect, 244 new RemoteDebuggerEvent(RemoteDebuggerEvent::kDisconnect,
245 i::SmartArrayPointer<char>()); 245 i::SmartArrayPointer<char>());
246 AddEvent(event); 246 AddEvent(event);
247 } 247 }
248 248
249 249
250 void RemoteDebugger::AddEvent(RemoteDebuggerEvent* event) { 250 void RemoteDebugger::AddEvent(RemoteDebuggerEvent* event) {
251 i::ScopedLock lock(event_access_); 251 i::LockGuard<i::Mutex> lock_guard(&event_access_);
252 if (head_ == NULL) { 252 if (head_ == NULL) {
253 ASSERT(tail_ == NULL); 253 ASSERT(tail_ == NULL);
254 head_ = event; 254 head_ = event;
255 tail_ = event; 255 tail_ = event;
256 } else { 256 } else {
257 ASSERT(tail_ != NULL); 257 ASSERT(tail_ != NULL);
258 tail_->set_next(event); 258 tail_->set_next(event);
259 tail_ = event; 259 tail_ = event;
260 } 260 }
261 event_available_->Signal(); 261 event_available_->Signal();
262 } 262 }
263 263
264 264
265 RemoteDebuggerEvent* RemoteDebugger::GetEvent() { 265 RemoteDebuggerEvent* RemoteDebugger::GetEvent() {
266 i::ScopedLock lock(event_access_); 266 i::LockGuard<i::Mutex> lock_guard(&event_access_);
267 ASSERT(head_ != NULL); 267 ASSERT(head_ != NULL);
268 RemoteDebuggerEvent* result = head_; 268 RemoteDebuggerEvent* result = head_;
269 head_ = head_->next(); 269 head_ = head_->next();
270 if (head_ == NULL) { 270 if (head_ == NULL) {
271 ASSERT(tail_ == result); 271 ASSERT(tail_ == result);
272 tail_ = NULL; 272 tail_ = NULL;
273 } 273 }
274 return result; 274 return result;
275 } 275 }
276 276
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 // Pass the keyboard command to the main thread. 365 // Pass the keyboard command to the main thread.
366 remote_debugger_->KeyboardCommand( 366 remote_debugger_->KeyboardCommand(
367 i::SmartArrayPointer<char>(i::StrDup(command))); 367 i::SmartArrayPointer<char>(i::StrDup(command)));
368 } 368 }
369 } 369 }
370 370
371 371
372 } // namespace v8 372 } // namespace v8
373 373
374 #endif // ENABLE_DEBUGGER_SUPPORT 374 #endif // ENABLE_DEBUGGER_SUPPORT
OLDNEW
« no previous file with comments | « src/d8-debug.h ('k') | src/debug.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698