Spring.NET 1.3.0 RC1 for .NET 2.0 API Reference

Semaphore Members

Semaphore overview

Public Instance Constructors

Semaphore Constructor

Create a Semaphore with the given initial number of permits.

Using a seed of 1 makes the semaphore act as a mutual exclusion lock.

Negative seeds are also allowed, in which case no acquires will proceed until the number of releases has pushed the number of permits past 0.

Public Instance Properties

Permits Return the current number of available permits. Returns an accurate, but possibly unstable value, that may change immediately after returning.

Public Instance Methods

Acquire Acquire a permit
Attempt Wait at most msecs millisconds for a permit
Equals (inherited from Object)Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object)Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object)Gets the Type of the current instance.
ReleaseOverloaded. Release a permit
ToString (inherited from Object)Returns a String that represents the current Object.

Protected Instance Fields

nPermits current number of available permits

Protected Instance Methods

Finalize (inherited from Object)Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object)Creates a shallow copy of the current Object.

See Also

Semaphore Class | Spring.Threading Namespace