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

Unified Diff: runtime/bin/dbg_connection.cc

Issue 15051002: Fix for issue 10488 standalone/basic_debugger_test flaky (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/dbg_connection.h ('k') | tests/standalone/standalone.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/dbg_connection.cc
===================================================================
--- runtime/bin/dbg_connection.cc (revision 22528)
+++ runtime/bin/dbg_connection.cc (working copy)
@@ -22,7 +22,7 @@
namespace bin {
int DebuggerConnectionHandler::listener_fd_ = -1;
-dart::Monitor DebuggerConnectionHandler::handler_lock_;
+dart::Monitor* DebuggerConnectionHandler::handler_lock_ = new dart::Monitor();
// TODO(asiva): Remove this once we have support for multiple debugger
// connections. For now we just store the single debugger connection
@@ -280,7 +280,8 @@
void DebuggerConnectionHandler::StartHandler(const char* address,
int port_number) {
- MonitorLocker ml(&handler_lock_);
+ ASSERT(handler_lock_ != NULL);
+ MonitorLocker ml(handler_lock_);
if (listener_fd_ != -1) {
return; // The debugger connection handler was already started.
}
@@ -307,7 +308,8 @@
void DebuggerConnectionHandler::WaitForConnection() {
- MonitorLocker ml(&handler_lock_);
+ ASSERT(handler_lock_ != NULL);
+ MonitorLocker ml(handler_lock_);
while (!IsConnected()) {
dart::Monitor::WaitResult res = ml.Wait();
ASSERT(res == dart::Monitor::kNotified);
@@ -316,13 +318,15 @@
void DebuggerConnectionHandler::SendMsg(int debug_fd, dart::TextBuffer* msg) {
- MonitorLocker ml(&handler_lock_);
+ ASSERT(handler_lock_ != NULL);
+ MonitorLocker ml(handler_lock_);
SendMsgHelper(debug_fd, msg);
}
void DebuggerConnectionHandler::BroadcastMsg(dart::TextBuffer* msg) {
- MonitorLocker ml(&handler_lock_);
+ ASSERT(handler_lock_ != NULL);
+ MonitorLocker ml(handler_lock_);
// TODO(asiva): Once we support connection to multiple debuggers
// we need to send the message to all of them.
ASSERT(singleton_handler != NULL);
@@ -371,7 +375,8 @@
void DebuggerConnectionHandler::AcceptDbgConnection(int debug_fd) {
AddNewDebuggerConnection(debug_fd);
{
- MonitorLocker ml(&handler_lock_);
+ ASSERT(handler_lock_ != NULL);
+ MonitorLocker ml(handler_lock_);
ml.NotifyAll();
}
// TODO(asiva): Once we implement support for multiple connections
« no previous file with comments | « runtime/bin/dbg_connection.h ('k') | tests/standalone/standalone.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698