7 #ifndef __LIBCAMERA_INTERNAL_SEMAPHORE_H__ 8 #define __LIBCAMERA_INTERNAL_SEMAPHORE_H__ 10 #include <condition_variable> 22 void acquire(
unsigned int n = 1);
24 void release(
unsigned int n = 1);
28 std::condition_variable cv_;
29 unsigned int available_;
std::mutex Mutex
An alias for std::mutex.
Definition: thread.h:27
General-purpose counting semaphore.
Definition: semaphore.h:16
unsigned int available()
Retrieve the number of available resources.
Definition: semaphore.cpp:43
Definition: bound_method.h:15
bool tryAcquire(unsigned int n=1)
Try to acquire n resources without blocking.
Definition: semaphore.cpp:75
void release(unsigned int n=1)
Release n resources.
Definition: semaphore.cpp:93
Semaphore(unsigned int n=0)
Construct a semaphore with n resources.
Definition: semaphore.cpp:34
void acquire(unsigned int n=1)
Acquire n resources.
Definition: semaphore.cpp:57