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_LOCKERS_H_ | 5 #ifndef VM_LOCKERS_H_ |
6 #define VM_LOCKERS_H_ | 6 #define VM_LOCKERS_H_ |
7 | 7 |
8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
9 #include "vm/allocation.h" | 9 #include "vm/allocation.h" |
10 #include "vm/globals.h" | 10 #include "vm/globals.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) { | 57 Monitor::WaitResult WaitMicros(int64_t micros = Monitor::kNoTimeout) { |
58 return monitor_->WaitMicros(micros); | 58 return monitor_->WaitMicros(micros); |
59 } | 59 } |
60 | 60 |
61 void Notify() { | 61 void Notify() { |
62 monitor_->Notify(); | 62 monitor_->Notify(); |
63 } | 63 } |
64 | 64 |
65 void NotifyAll() { | 65 void NotifyAll() { |
66 monitor_->NotifyAll(); | 66 monitor_->NotifyAll(); |
67 } | 67 } |
68 | 68 |
69 private: | 69 private: |
70 Monitor* const monitor_; | 70 Monitor* const monitor_; |
71 | 71 |
72 DISALLOW_COPY_AND_ASSIGN(MonitorLocker); | 72 DISALLOW_COPY_AND_ASSIGN(MonitorLocker); |
73 }; | 73 }; |
74 | 74 |
75 } // namespace dart | 75 } // namespace dart |
76 | 76 |
77 | 77 |
78 #endif // VM_LOCKERS_H_ | 78 #endif // VM_LOCKERS_H_ |
OLD | NEW |