Abstraction of a semaphore. A semaphore object is a synchronization object that maintains a count between zero and a specified maximum value. The count is decremented each time a thread completes a wait for the semaphore object and incremented each time a thread releases the semaphore. When the count reaches zero, no more threads can successfully wait for the semaphore object state to become signaled. The state of a semaphore is set to signaled when its count is greater than zero, and nonsignaled when its count is zero. More...
Abstraction of a semaphore. A semaphore object is a synchronization object that maintains a count between zero and a specified maximum value. The count is decremented each time a thread completes a wait for the semaphore object and incremented each time a thread releases the semaphore. When the count reaches zero, no more threads can successfully wait for the semaphore object state to become signaled. The state of a semaphore is set to signaled when its count is greater than zero, and nonsignaled when its count is zero.
Inheritance diagram for Semaphore:Public Member Methods | |
| Semaphore (Int32 initialCount) | |
| Constructor. More... | |
| Semaphore (Int32 initialCount, Int32 maxCount) | |
| Constructor. More... | |
| Semaphore (PCChar8 name, Int32 initialCount, Int32 maxCount) | |
| Constructor. More... | |
| Semaphore (PCChar8 name, Int32 initialCount) | |
| Constructor. More... | |
| ~Semaphore () | |
| Destructor. More... | |
| void | Lock () |
| Locks the Semaphore. More... | |
| bool | Lock (TimeSpan timeOut) |
| Locks the Semaphore. More... | |
| void | Unlock () |
| Unlocks the Semaphore. More... | |
Constructor.
| initialCount | Initial value of the semaphore. maxCount limit fixed at MaxInt32 |
Constructor.
| initialCount | Initial value of the semaphore. |
| maxCount | Maximum value of the semaphore. |
Constructor.
| name | The name. |
| initialCount | Initial value of the semaphore. |
| maxCount | Maximum value of the semaphore. |
Constructor.
| name | The name. |
| initialCount | Initial value of the semaphore. |
| ~Semaphore | ( | ) |
Destructor.
| void Lock | ( | ) |
Locks the Semaphore.
| bool Lock | ( | TimeSpan | timeOut | ) |
Locks the Semaphore.
| timeOut | The time out. |
| void Unlock | ( | ) |
Unlocks the Semaphore.