| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 | 207 |
| 208 template <typename Mutex> | 208 template <typename Mutex> |
| 209 class LockGuard V8_FINAL { | 209 class LockGuard V8_FINAL { |
| 210 public: | 210 public: |
| 211 explicit LockGuard(Mutex* mutex) : mutex_(mutex) { mutex_->Lock(); } | 211 explicit LockGuard(Mutex* mutex) : mutex_(mutex) { mutex_->Lock(); } |
| 212 ~LockGuard() { mutex_->Unlock(); } | 212 ~LockGuard() { mutex_->Unlock(); } |
| 213 | 213 |
| 214 private: | 214 private: |
| 215 Mutex* mutex_; | 215 Mutex* mutex_; |
| 216 | 216 |
| 217 LockGuard(const LockGuard<Mutex>& other) V8_DELETE; | 217 DISALLOW_COPY_AND_ASSIGN(LockGuard); |
| 218 LockGuard<Mutex>& operator=(const LockGuard<Mutex>& other) V8_DELETE; | |
| 219 }; | 218 }; |
| 220 | 219 |
| 221 } } // namespace v8::internal | 220 } } // namespace v8::internal |
| 222 | 221 |
| 223 #endif // V8_PLATFORM_MUTEX_H_ | 222 #endif // V8_PLATFORM_MUTEX_H_ |
| OLD | NEW |