A C++ Library to handle POSIX named Semaphores.
const std::string sem_name = "example_sem"; // semaphore name
constexpr unsigned sem_value = 1; // initial semaphore value
constexpr bool force = false; // fail if semaphore already exists
// create semaphore
cxxsemaphore::Semaphore sem(sem_name, sem_value, force);
const std::string sem_name = "example_sem"; // semaphore name
// use semaphore
cxxsemaphore::Semaphore sem(shm_name, read_only);
sem.wait();
bool success = sem.wait({2, 0});
bool success = sem.try_wait();
sem.post()