Spring.NET 1.3.0 RC1 for .NET 2.0 API Reference

Semaphore Class

Base class for counting semaphores based on Semaphore implementation from Doug Lea.

For a list of all members of this type, see Semaphore Members .


[Visual Basic]
Public Class Semaphore
    Implements ISync
public class Semaphore : ISync

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.


Conceptually, a semaphore maintains a set of permits. Each acquire() blocks if necessary until a permit is available, and then takes it.

Each release adds a permit. However, no actual permit objects are used; the Semaphore just keeps a count of the number available and acts accordingly.

A semaphore initialized to 1 can serve as a mutual exclusion lock.

Used for implementation of a SimplePool


Namespace: Spring.Threading

Assembly: Spring.Core (in Spring.Core.dll)

See Also

Semaphore Members | Spring.Threading Namespace