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

Side by Side Diff: src/debug.cc

Issue 50007: Better handling of startup and shutdown of the debugger agent (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 9 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/debug.h ('k') | src/debug-agent.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 1821 matching lines...) Expand 10 before | Expand all | Expand 10 after
1832 if (Socket::Setup()) { 1832 if (Socket::Setup()) {
1833 agent_ = new DebuggerAgent(port); 1833 agent_ = new DebuggerAgent(port);
1834 agent_->Start(); 1834 agent_->Start();
1835 return true; 1835 return true;
1836 } 1836 }
1837 1837
1838 return false; 1838 return false;
1839 } 1839 }
1840 1840
1841 1841
1842 void Debugger::StopAgent() {
1843 if (agent_ != NULL) {
1844 agent_->Shutdown();
1845 agent_->Join();
1846 delete agent_;
1847 agent_ = NULL;
1848 }
1849 }
1850
1851
1842 DebugMessageThread::DebugMessageThread() 1852 DebugMessageThread::DebugMessageThread()
1843 : host_running_(true), 1853 : host_running_(true),
1844 command_queue_(kQueueInitialSize), 1854 command_queue_(kQueueInitialSize),
1845 message_queue_(kQueueInitialSize) { 1855 message_queue_(kQueueInitialSize) {
1846 command_received_ = OS::CreateSemaphore(0); 1856 command_received_ = OS::CreateSemaphore(0);
1847 message_received_ = OS::CreateSemaphore(0); 1857 message_received_ = OS::CreateSemaphore(0);
1848 } 1858 }
1849 1859
1850 // Does not free resources held by DebugMessageThread 1860 // Does not free resources held by DebugMessageThread
1851 // because this cannot be done thread-safely. 1861 // because this cannot be done thread-safely.
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
2171 } 2181 }
2172 2182
2173 2183
2174 void LockingMessageQueue::Clear() { 2184 void LockingMessageQueue::Clear() {
2175 ScopedLock sl(lock_); 2185 ScopedLock sl(lock_);
2176 queue_.Clear(); 2186 queue_.Clear();
2177 } 2187 }
2178 2188
2179 2189
2180 } } // namespace v8::internal 2190 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/debug.h ('k') | src/debug-agent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698