roo_threads
API Documentation for roo_threads
Loading...
Searching...
No Matches
semaphore.h
Go to the documentation of this file.
1#pragma once
2
4
5#ifdef ROO_THREADS_USE_CPPSTD
6
7#include <semaphore>
8
9namespace roo_threads {
10/// @brief Backend namespace using C++ standard library synchronization primitives.
11namespace cppstd {
12
13/// @ingroup roo_threads_api_semaphore
14/// @brief C++ standard library backend implementation of
15/// `roo::counting_semaphore`.
16/// @copydoc roo_threads::doc::counting_semaphore
17template <ptrdiff_t LeastMaxValue = std::counting_semaphore<>::max()>
18using counting_semaphore = std::counting_semaphore<LeastMaxValue>;
19
20/// @ingroup roo_threads_api_semaphore
21/// @brief C++ standard library backend implementation of
22/// `roo::binary_semaphore`.
23/// @copydoc roo_threads::doc::binary_semaphore
24using binary_semaphore = std::binary_semaphore;
25
26} // namespace cppstd
27} // namespace roo_threads
28
29#endif // ROO_THREADS_USE_CPPSTD
counting_semaphore< 1 > binary_semaphore
Semaphore with maximum count of one.