| 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" |
| 11 #include "vm/isolate.h" | 11 #include "vm/isolate.h" |
| 12 #include "vm/thread.h" | 12 #include "vm/os_thread.h" |
| 13 | 13 |
| 14 namespace dart { | 14 namespace dart { |
| 15 | 15 |
| 16 class MutexLocker : public ValueObject { | 16 class MutexLocker : public ValueObject { |
| 17 public: | 17 public: |
| 18 explicit MutexLocker(Mutex* mutex) : mutex_(mutex) { | 18 explicit MutexLocker(Mutex* mutex) : mutex_(mutex) { |
| 19 ASSERT(mutex != NULL); | 19 ASSERT(mutex != NULL); |
| 20 // TODO(iposva): Consider adding a no GC scope here. | 20 // TODO(iposva): Consider adding a no GC scope here. |
| 21 mutex_->Lock(); | 21 mutex_->Lock(); |
| 22 } | 22 } |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 private: | 65 private: |
| 66 Monitor* const monitor_; | 66 Monitor* const monitor_; |
| 67 | 67 |
| 68 DISALLOW_COPY_AND_ASSIGN(MonitorLocker); | 68 DISALLOW_COPY_AND_ASSIGN(MonitorLocker); |
| 69 }; | 69 }; |
| 70 | 70 |
| 71 } // namespace dart | 71 } // namespace dart |
| 72 | 72 |
| 73 | 73 |
| 74 #endif // VM_LOCKERS_H_ | 74 #endif // VM_LOCKERS_H_ |
| OLD | NEW |