OLD | NEW |
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 VM_THREAD_H_ | 5 #ifndef VM_THREAD_H_ |
6 #define VM_THREAD_H_ | 6 #define VM_THREAD_H_ |
7 | 7 |
8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
9 #include "platform/thread.h" | 9 #include "platform/thread.h" |
10 #include "vm/allocation.h" | 10 #include "vm/allocation.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 | 47 |
48 virtual ~MonitorLocker() { | 48 virtual ~MonitorLocker() { |
49 monitor_->Exit(); | 49 monitor_->Exit(); |
50 // TODO(iposva): Consider decrementing the no GC scope here. | 50 // TODO(iposva): Consider decrementing the no GC scope here. |
51 } | 51 } |
52 | 52 |
53 Monitor::WaitResult Wait(int64_t millis = Monitor::kNoTimeout) { | 53 Monitor::WaitResult Wait(int64_t millis = Monitor::kNoTimeout) { |
54 return monitor_->Wait(millis); | 54 return monitor_->Wait(millis); |
55 } | 55 } |
56 | 56 |
| 57 Monitor::WaitResult WaitMicros(int64_t micros = dart::Monitor::kNoTimeout) { |
| 58 return monitor_->WaitMicros(micros); |
| 59 } |
| 60 |
57 void Notify() { | 61 void Notify() { |
58 monitor_->Notify(); | 62 monitor_->Notify(); |
59 } | 63 } |
60 | 64 |
61 void NotifyAll() { | 65 void NotifyAll() { |
62 monitor_->NotifyAll(); | 66 monitor_->NotifyAll(); |
63 } | 67 } |
64 | 68 |
65 private: | 69 private: |
66 Monitor* const monitor_; | 70 Monitor* const monitor_; |
67 | 71 |
68 DISALLOW_COPY_AND_ASSIGN(MonitorLocker); | 72 DISALLOW_COPY_AND_ASSIGN(MonitorLocker); |
69 }; | 73 }; |
70 | 74 |
71 } // namespace dart | 75 } // namespace dart |
72 | 76 |
73 | 77 |
74 #endif // VM_THREAD_H_ | 78 #endif // VM_THREAD_H_ |
OLD | NEW |