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

Side by Side Diff: dart/runtime/bin/eventhandler_macos.h

Issue 879353003: Introduce optional 'bool shared' parameter to ServerSocket.bind() ... (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Part 2: Smaller cleanups to align linux/android/mac versions more Created 5 years, 10 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
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_MACOS_H_ 5 #ifndef BIN_EVENTHANDLER_MACOS_H_
6 #define BIN_EVENTHANDLER_MACOS_H_ 6 #define BIN_EVENTHANDLER_MACOS_H_
7 7
8 #if !defined(BIN_EVENTHANDLER_H_) 8 #if !defined(BIN_EVENTHANDLER_H_)
9 #error Do not include eventhandler_macos.h directly; use eventhandler.h instead. 9 #error Do not include eventhandler_macos.h directly; use eventhandler.h instead.
10 #endif 10 #endif
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 intptr_t fd() { return fd_; } 54 intptr_t fd() { return fd_; }
55 Dart_Port port() { return port_; } 55 Dart_Port port() { return port_; }
56 intptr_t mask() { return mask_; } 56 intptr_t mask() { return mask_; }
57 bool tracked_by_kqueue() { return tracked_by_kqueue_; } 57 bool tracked_by_kqueue() { return tracked_by_kqueue_; }
58 void set_tracked_by_kqueue(bool value) { 58 void set_tracked_by_kqueue(bool value) {
59 tracked_by_kqueue_ = value; 59 tracked_by_kqueue_ = value;
60 } 60 }
61 61
62 // Returns true if the last token was taken. 62 // Returns true if the last token was taken.
63 bool TakeToken() { 63 bool TakeToken() {
64 ASSERT(tokens_ > 0);
64 tokens_--; 65 tokens_--;
65 return tokens_ == 0; 66 return tokens_ == 0;
66 } 67 }
67 68
68 // Returns true if the tokens was 0 before adding. 69 // Returns true if the tokens was 0 before adding.
69 bool ReturnToken() { 70 bool ReturnToken() {
70 tokens_++; 71 tokens_++;
71 return tokens_ == 1; 72 return tokens_ == 1;
72 } 73 }
73 74
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 TimeoutQueue timeout_queue_; 109 TimeoutQueue timeout_queue_;
109 bool shutdown_; 110 bool shutdown_;
110 int interrupt_fds_[2]; 111 int interrupt_fds_[2];
111 int kqueue_fd_; 112 int kqueue_fd_;
112 }; 113 };
113 114
114 } // namespace bin 115 } // namespace bin
115 } // namespace dart 116 } // namespace dart
116 117
117 #endif // BIN_EVENTHANDLER_MACOS_H_ 118 #endif // BIN_EVENTHANDLER_MACOS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698