threading: semaphore: remove temporary convenience types

This commit is contained in:
Cory Fields
2025-05-08 19:43:55 +00:00
parent 1f89e2a49a
commit fd15469892

View File

@@ -301,9 +301,6 @@ inline MutexType* MaybeCheckNotHeld(MutexType* m) LOCKS_EXCLUDED(m) LOCK_RETURNE
//! gcc and the -Wreturn-stack-address flag in clang, both enabled by default. //! gcc and the -Wreturn-stack-address flag in clang, both enabled by default.
#define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }()) #define WITH_LOCK(cs, code) (MaybeCheckNotHeld(cs), [&]() -> decltype(auto) { LOCK(cs); code; }())
using BinarySemaphore = std::binary_semaphore;
using Semaphore = std::counting_semaphore<>;
/** RAII-style semaphore lock */ /** RAII-style semaphore lock */
template <std::ptrdiff_t LeastMaxValue = std::counting_semaphore<>::max()> template <std::ptrdiff_t LeastMaxValue = std::counting_semaphore<>::max()>
class CountingSemaphoreGrant class CountingSemaphoreGrant
@@ -385,6 +382,5 @@ public:
}; };
using BinarySemaphoreGrant = CountingSemaphoreGrant<1>; using BinarySemaphoreGrant = CountingSemaphoreGrant<1>;
using SemaphoreGrant = CountingSemaphoreGrant<>;
#endif // BITCOIN_SYNC_H #endif // BITCOIN_SYNC_H