Added default constructor for Semaphore

Currently Semaphore can not be instantiated without an explicit count
as a constructor argument. This limits where Semaphores can be declared
and requires explicit initialization in several annoying places, such
as in member variables and SingletonPtr targets.

This adds a default count of 0, which has shown to be the most common
initial value used for semaphores.
pull/2189/head
Christopher Haster 2016-07-18 14:51:38 -05:00
parent 3ea625c8eb
commit 0140dc2e80
1 changed files with 2 additions and 2 deletions

View File

@ -31,9 +31,9 @@ namespace rtos {
class Semaphore {
public:
/** Create and Initialize a Semaphore object used for managing resources.
@param number of available resources; maximum index value is (count-1).
@param number of available resources; maximum index value is (count-1). (default: 0).
*/
Semaphore(int32_t count);
Semaphore(int32_t count=0);
/** Wait until a Semaphore resource becomes available.
@param millisec timeout value or 0 in case of no time-out. (default: osWaitForever).