| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 virtual ~MonitorLocker() { | 44 virtual ~MonitorLocker() { |
| 45 monitor_->Exit(); | 45 monitor_->Exit(); |
| 46 // TODO(iposva): Consider decrementing the no GC scope here. | 46 // TODO(iposva): Consider decrementing the no GC scope here. |
| 47 } | 47 } |
| 48 | 48 |
| 49 Monitor::WaitResult Wait(int64_t millis = Monitor::kNoTimeout) { | 49 Monitor::WaitResult Wait(int64_t millis = Monitor::kNoTimeout) { |
| 50 return monitor_->Wait(millis); | 50 return monitor_->Wait(millis); |
| 51 } | 51 } |
| 52 | 52 |
| 53 Monitor::WaitResult WaitWithSafepointCheck( |
| 54 Thread* thread, int64_t millis = Monitor::kNoTimeout); |
| 55 |
| 53 Monitor::WaitResult WaitMicros(int64_t micros = Monitor::kNoTimeout) { | 56 Monitor::WaitResult WaitMicros(int64_t micros = Monitor::kNoTimeout) { |
| 54 return monitor_->WaitMicros(micros); | 57 return monitor_->WaitMicros(micros); |
| 55 } | 58 } |
| 56 | 59 |
| 57 void Notify() { | 60 void Notify() { |
| 58 monitor_->Notify(); | 61 monitor_->Notify(); |
| 59 } | 62 } |
| 60 | 63 |
| 61 void NotifyAll() { | 64 void NotifyAll() { |
| 62 monitor_->NotifyAll(); | 65 monitor_->NotifyAll(); |
| 63 } | 66 } |
| 64 | 67 |
| 65 private: | 68 private: |
| 66 Monitor* const monitor_; | 69 Monitor* const monitor_; |
| 67 | 70 |
| 68 DISALLOW_COPY_AND_ASSIGN(MonitorLocker); | 71 DISALLOW_COPY_AND_ASSIGN(MonitorLocker); |
| 69 }; | 72 }; |
| 70 | 73 |
| 71 } // namespace dart | 74 } // namespace dart |
| 72 | 75 |
| 73 | 76 |
| 74 #endif // VM_LOCKERS_H_ | 77 #endif // VM_LOCKERS_H_ |
| OLD | NEW |