org.objectweb.dream.synchro
Interface SemaphoreAttributeController

All Superinterfaces:
AttributeController
All Known Implementing Classes:
AbstractSemaphoreQueuedImpl, SemaphoreFIFOImpl, SemaphoreImpl

public interface SemaphoreAttributeController
extends AttributeController

An attribute controller allowing setting the initial number of permits of the semaphore.


Method Summary
 long getInitialPermits()
          Returns the initial number of permits of the semaphore.
 void setInitialPermits(long initialPermits)
          Sets the initial number of permits of the semaphore.
 

Method Detail

setInitialPermits

void setInitialPermits(long initialPermits)
Sets the initial number of permits of the semaphore. Setting initialPermits to one 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.

Parameters:
initialPermits - the initial number of permits to set.

getInitialPermits

long getInitialPermits()
Returns the initial number of permits of the semaphore.

Returns:
the initial number of permits of the semaphore.


Copyright © 2003, 2005 - INRIA Rhone-Alpes - All Rights Reserved.