14 #include <mrpt/config.h> 16 #ifdef MRPT_OS_WINDOWS 30 unsigned int initialCount,
35 HANDLE hSem = CreateSemaphoreA(
70 DWORD tim = (timeout_ms==0) ? INFINITE : timeout_ms;
71 DWORD ret = WaitForSingleObject( *
m_data.
getAsPtr<HANDLE>(), tim );
73 return (ret==WAIT_OBJECT_0);
85 if (!ReleaseSemaphore(
CSemaphore(unsigned int initialCount, unsigned int maxCount)
Creates a semaphore.
virtual ~CSemaphore()
Dtor.
#define THROW_EXCEPTION(msg)
void resize(size_t mem_block_size)
Resize the shared memory block.
unsigned int alias_count() const
void release(unsigned int increaseCount=1)
Increments the count of the semaphore by a given amount.
This namespace provides multitask, synchronization utilities.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
mrpt::utils::CReferencedMemBlock m_data
bool waitForSignal(unsigned int timeout_ms=0)
Blocks until the count of the semaphore to be non-zero.