Class SyncCounter[in Threading]

Implements a synchronization counter (semaphore).

class SyncCounter( [count] )

more...

Summary

initImplements a synchronization counter (semaphore).
post()Releases the counter or increases the counter by more than one.

Detailed description

Implements a synchronization counter (semaphore).

This class implements a synchronization counter, commonly known as "semaphore", which provides the following behavior:

We have adopted the "counter" name rather than the more common "semaphore" to avoid confusion with the Semaphore class used for coroutines, and also because the post semantic is merged with the release method.

Init Block

Implements a synchronization counter (semaphore).

init SyncCounter( [count] )

countInitial counter value (defaults to 0).

This class implements a synchronization counter, commonly known as "semaphore", which provides the following behavior:

We have adopted the "counter" name rather than the more common "semaphore" to avoid confusion with the Semaphore class used for coroutines, and also because the post semantic is merged with the release method.

Methods

post()

Releases the counter or increases the counter by more than one.

SyncCounter.post( [count] )

countThe number of signalations to be posted to this semaphore.

This method acts as release(), but it can be provided an optional parameter to give more than one thread the ability to acquire this structure.

It is not possible to use this method to reduce the internal count.


Made with faldoc 2.1.0