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

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

Issue 23748003: Cleanup Semaphore class. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Build fix for Mac OS X. 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.cc ('k') | src/d8-debug.cc » ('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 2008 the V8 project authors. All rights reserved. 1 // Copyright 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 class RemoteDebuggerEvent; 46 class RemoteDebuggerEvent;
47 class ReceiverThread; 47 class ReceiverThread;
48 48
49 49
50 // Remote debugging class. 50 // Remote debugging class.
51 class RemoteDebugger { 51 class RemoteDebugger {
52 public: 52 public:
53 explicit RemoteDebugger(Isolate* isolate, int port) 53 explicit RemoteDebugger(Isolate* isolate, int port)
54 : isolate_(isolate), 54 : isolate_(isolate),
55 port_(port), 55 port_(port),
56 event_available_(i::OS::CreateSemaphore(0)), 56 event_available_(0),
57 head_(NULL), tail_(NULL) {} 57 head_(NULL), tail_(NULL) {}
58 void Run(); 58 void Run();
59 59
60 // Handle events from the subordinate threads. 60 // Handle events from the subordinate threads.
61 void MessageReceived(i::SmartArrayPointer<char> message); 61 void MessageReceived(i::SmartArrayPointer<char> message);
62 void KeyboardCommand(i::SmartArrayPointer<char> command); 62 void KeyboardCommand(i::SmartArrayPointer<char> command);
63 void ConnectionClosed(); 63 void ConnectionClosed();
64 64
65 private: 65 private:
66 // Add new debugger event to the list. 66 // Add new debugger event to the list.
(...skipping 10 matching lines...) Expand all
77 i::Socket* conn() { return conn_; } 77 i::Socket* conn() { return conn_; }
78 78
79 Isolate* isolate_; 79 Isolate* isolate_;
80 int port_; // Port used to connect to debugger V8. 80 int port_; // Port used to connect to debugger V8.
81 i::Socket* conn_; // Connection to debugger agent in debugged V8. 81 i::Socket* conn_; // Connection to debugger agent in debugged V8.
82 82
83 // Linked list of events from debugged V8 and from keyboard input. Access to 83 // Linked list of events from debugged V8 and from keyboard input. Access to
84 // the list is guarded by a mutex and a semaphore signals new items in the 84 // the list is guarded by a mutex and a semaphore signals new items in the
85 // list. 85 // list.
86 i::Mutex event_access_; 86 i::Mutex event_access_;
87 i::Semaphore* event_available_; 87 i::Semaphore event_available_;
88 RemoteDebuggerEvent* head_; 88 RemoteDebuggerEvent* head_;
89 RemoteDebuggerEvent* tail_; 89 RemoteDebuggerEvent* tail_;
90 90
91 friend class ReceiverThread; 91 friend class ReceiverThread;
92 }; 92 };
93 93
94 94
95 // Thread reading from debugged V8 instance. 95 // Thread reading from debugged V8 instance.
96 class ReceiverThread: public i::Thread { 96 class ReceiverThread: public i::Thread {
97 public: 97 public:
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 RemoteDebuggerEvent* next_; 146 RemoteDebuggerEvent* next_;
147 147
148 friend class RemoteDebugger; 148 friend class RemoteDebugger;
149 }; 149 };
150 150
151 151
152 } // namespace v8 152 } // namespace v8
153 153
154 154
155 #endif // V8_D8_DEBUG_H_ 155 #endif // V8_D8_DEBUG_H_
OLDNEW
« no previous file with comments | « src/d8.cc ('k') | src/d8-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698