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

Side by Side Diff: runtime/bin/eventhandler_win.h

Issue 1989463003: Add back join of windows eventhandler threads (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | runtime/bin/eventhandler_win.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 (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef BIN_EVENTHANDLER_WIN_H_ 5 #ifndef BIN_EVENTHANDLER_WIN_H_
6 #define BIN_EVENTHANDLER_WIN_H_ 6 #define BIN_EVENTHANDLER_WIN_H_
7 7
8 #if !defined(BIN_EVENTHANDLER_H_) 8 #if !defined(BIN_EVENTHANDLER_H_)
9 #error Do not include eventhandler_win.h directly; use eventhandler.h instead. 9 #error Do not include eventhandler_win.h directly; use eventhandler.h instead.
10 #endif 10 #endif
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 HANDLE completion_port_; 256 HANDLE completion_port_;
257 EventHandlerImplementation* event_handler_; 257 EventHandlerImplementation* event_handler_;
258 258
259 OverlappedBuffer* data_ready_; // Buffer for data ready to be read. 259 OverlappedBuffer* data_ready_; // Buffer for data ready to be read.
260 OverlappedBuffer* pending_read_; // Buffer for pending read. 260 OverlappedBuffer* pending_read_; // Buffer for pending read.
261 OverlappedBuffer* pending_write_; // Buffer for pending write 261 OverlappedBuffer* pending_write_; // Buffer for pending write
262 262
263 DWORD last_error_; 263 DWORD last_error_;
264 264
265 ThreadId read_thread_id_; 265 ThreadId read_thread_id_;
266 HANDLE read_thread_handle_;
266 bool read_thread_starting_; 267 bool read_thread_starting_;
267 bool read_thread_finished_; 268 bool read_thread_finished_;
268 269
269 private: 270 private:
270 void WaitForReadThreadStarted(); 271 void WaitForReadThreadStarted();
271 void NotifyReadThreadStarted(); 272 void NotifyReadThreadStarted();
272 void WaitForReadThreadFinished(); 273 void WaitForReadThreadFinished();
273 void NotifyReadThreadFinished(); 274 void NotifyReadThreadFinished();
274 275
275 int flags_; 276 int flags_;
(...skipping 15 matching lines...) Expand all
291 private: 292 private:
292 DISALLOW_COPY_AND_ASSIGN(FileHandle); 293 DISALLOW_COPY_AND_ASSIGN(FileHandle);
293 }; 294 };
294 295
295 296
296 class StdHandle : public FileHandle { 297 class StdHandle : public FileHandle {
297 public: 298 public:
298 explicit StdHandle(HANDLE handle) 299 explicit StdHandle(HANDLE handle)
299 : FileHandle(handle), 300 : FileHandle(handle),
300 thread_id_(Thread::kInvalidThreadId), 301 thread_id_(Thread::kInvalidThreadId),
302 thread_handle_(NULL),
301 thread_wrote_(0), 303 thread_wrote_(0),
302 write_thread_exists_(false), 304 write_thread_exists_(false),
303 write_thread_running_(false) { 305 write_thread_running_(false) {
304 type_ = kStd; 306 type_ = kStd;
305 } 307 }
306 308
307 virtual void DoClose(); 309 virtual void DoClose();
308 virtual intptr_t Write(const void* buffer, intptr_t num_bytes); 310 virtual intptr_t Write(const void* buffer, intptr_t num_bytes);
309 311
310 void WriteSyncCompleteAsync(); 312 void WriteSyncCompleteAsync();
311 void RunWriteLoop(); 313 void RunWriteLoop();
312 314
313 private: 315 private:
314 ThreadId thread_id_; 316 ThreadId thread_id_;
317 HANDLE thread_handle_;
315 intptr_t thread_wrote_; 318 intptr_t thread_wrote_;
316 bool write_thread_exists_; 319 bool write_thread_exists_;
317 bool write_thread_running_; 320 bool write_thread_running_;
318 321
319 DISALLOW_COPY_AND_ASSIGN(StdHandle); 322 DISALLOW_COPY_AND_ASSIGN(StdHandle);
320 }; 323 };
321 324
322 325
323 class DirectoryWatchHandle : public DescriptorInfoSingleMixin<Handle> { 326 class DirectoryWatchHandle : public DescriptorInfoSingleMixin<Handle> {
324 public: 327 public:
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 OverlappedBuffer* buffer); 534 OverlappedBuffer* buffer);
532 void HandleIOCompletion(DWORD bytes, ULONG_PTR key, OVERLAPPED* overlapped); 535 void HandleIOCompletion(DWORD bytes, ULONG_PTR key, OVERLAPPED* overlapped);
533 536
534 HANDLE completion_port() { return completion_port_; } 537 HANDLE completion_port() { return completion_port_; }
535 538
536 private: 539 private:
537 ClientSocket* client_sockets_head_; 540 ClientSocket* client_sockets_head_;
538 541
539 Monitor* startup_monitor_; 542 Monitor* startup_monitor_;
540 ThreadId handler_thread_id_; 543 ThreadId handler_thread_id_;
544 HANDLE handler_thread_handle_;
541 545
542 TimeoutQueue timeout_queue_; // Time for next timeout. 546 TimeoutQueue timeout_queue_; // Time for next timeout.
543 bool shutdown_; 547 bool shutdown_;
544 HANDLE completion_port_; 548 HANDLE completion_port_;
545 549
546 DISALLOW_COPY_AND_ASSIGN(EventHandlerImplementation); 550 DISALLOW_COPY_AND_ASSIGN(EventHandlerImplementation);
547 }; 551 };
548 552
549 } // namespace bin 553 } // namespace bin
550 } // namespace dart 554 } // namespace dart
551 555
552 #endif // BIN_EVENTHANDLER_WIN_H_ 556 #endif // BIN_EVENTHANDLER_WIN_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/bin/eventhandler_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698