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

Side by Side Diff: src/debug.cc

Issue 503022: Add locker support to DebugMessageDispatchHandler (Closed)
Patch Set: make compilable with debugger support off Created 11 years 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
« no previous file with comments | « src/api.cc ('k') | src/v8threads.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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 2420 matching lines...) Expand 10 before | Expand all | Expand 10 after
2431 client_data); 2431 client_data);
2432 Logger::DebugTag("Put command on command_queue."); 2432 Logger::DebugTag("Put command on command_queue.");
2433 command_queue_.Put(message); 2433 command_queue_.Put(message);
2434 command_received_->Signal(); 2434 command_received_->Signal();
2435 2435
2436 // Set the debug command break flag to have the command processed. 2436 // Set the debug command break flag to have the command processed.
2437 if (!Debug::InDebugger()) { 2437 if (!Debug::InDebugger()) {
2438 StackGuard::DebugCommand(); 2438 StackGuard::DebugCommand();
2439 } 2439 }
2440 2440
2441 if (Debugger::debug_message_dispatch_handler_ != NULL) { 2441 {
2442 Debugger::debug_message_dispatch_handler_(); 2442 // TODO: Lock only optionally
2443 LockParameters lock_params;
2444 Locker lock(&lock_params);
2445 if (lock_params.successfully_relaied) {
2446 } else {
2447 if (Debugger::debug_message_dispatch_handler_ != NULL) {
2448 Debugger::debug_message_dispatch_handler_();
2449 }
2450 }
2443 } 2451 }
2444 } 2452 }
2445 2453
2446 2454
2447 bool Debugger::HasCommands() { 2455 bool Debugger::HasCommands() {
2448 return !command_queue_.IsEmpty(); 2456 return !command_queue_.IsEmpty();
2449 } 2457 }
2450 2458
2451 2459
2452 bool Debugger::IsDebuggerActive() { 2460 bool Debugger::IsDebuggerActive() {
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
2742 2750
2743 2751
2744 void LockingCommandMessageQueue::Clear() { 2752 void LockingCommandMessageQueue::Clear() {
2745 ScopedLock sl(lock_); 2753 ScopedLock sl(lock_);
2746 queue_.Clear(); 2754 queue_.Clear();
2747 } 2755 }
2748 2756
2749 #endif // ENABLE_DEBUGGER_SUPPORT 2757 #endif // ENABLE_DEBUGGER_SUPPORT
2750 2758
2751 } } // namespace v8::internal 2759 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/v8threads.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698