JeVois Smart Embedded Machine Vision Toolkit
A simple semaphore.
A semaphore is a thread-safe mechanism to share resources between multiple threads of execution.
See this Wikipedia page for basic information: http://en.wikipedia.org/wiki/Semaphore_%28programming%29
This code is derived from the Neuromorphic Robotics Toolkit (NRT).
|BB||defines the blocking behavior and should be a value from jevois::BlockingBehavior|
|Semaphore (size_t n=0)|
|Create a semaphore with n initial resources. More...|
|void||increment (size_t n)|
|Release n resources to the semaphore. More...|
|void||decrement (size_t n)|
|Remove n resources from the semaphore, blocking until they are available or throwing if they are not. More...|
|size_t||count () const|
|Get the current count. More...|
|void jevois::Semaphore< BB >::decrement||(||size_t||n||)|
Remove n resources from the semaphore, blocking until they are available or throwing if they are not.