| // Copyright 2013 the V8 project authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| // https://cs.chromium.org/chromium/src/v8/src/base/platform/semaphore.h |
| #ifndef UTIL_SEMAPHORE_H_ |
| #define UTIL_SEMAPHORE_H_ |
| #include "util/build_config.h" |
| explicit Semaphore(int count); |
| // Increments the semaphore counter. |
| // Decrements the semaphore counter if it is positive, or blocks until it |
| // becomes positive and then decrements the counter. |
| typedef semaphore_t NativeHandle; |
| typedef sem_t NativeHandle; |
| typedef HANDLE NativeHandle; |
| NativeHandle& native_handle() { return native_handle_; } |
| const NativeHandle& native_handle() const { return native_handle_; } |
| NativeHandle native_handle_; |
| DISALLOW_COPY_AND_ASSIGN(Semaphore); |
| #endif // UTIL_SEMAPHORE_H_ |