Overview | Package | Class | Tree | Deprecated | Index | Help
| SolarMetric Kodo JDO 2.5.8 generated on January 11 2004
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## serp.util
Class Semaphore

    java.lang.Object
      |
      +--serp.util.Semaphore

All Implemented Interfaces:
  Serializable

public class Semaphore
extends Object
implements Serializable

Semaphore implementation.

See Also:
  Serialized Form

Constructor Summary
`Semaphore()` Construct the semaphore with an initial available count of 1.
`Semaphore(int available)` Construct the semaphore with an initial available count of `avaiable`.

Method Summary
`void` | `down()` Down the semaphore's available count.
`boolean` | `down(long timeout)` Down the semaphore's available count.
`int` | `getAvailable()` Returns the current available count.
`void` | `up()` Up the semaphore.

Methods inherited from class java.lang.Object
`, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### Semaphore

    public Semaphore()

  Construct the semaphore with an initial available count of 1.

### Semaphore

    public Semaphore(int available)

  Construct the semaphore with an initial available count of `avaiable`.

Method Detail

### getAvailable

    public int getAvailable()

  Returns the current available count.

### down

    public void down()

  Down the semaphore's available count. If the count is at 0, this call will block until the semaphore is `up()`'d.

### down

    public boolean down(long timeout)

  Down the semaphore's available count. If the count is at 0, this call will block until the semaphore is `up()`'d or the given timeout elapses.
  Returns:
    true if the semaphore was down'd, false on timeout

### up

    public void up()

  Up the semaphore.

Overview | Package | Class | Tree | Deprecated | Index | Help
| SolarMetric Kodo JDO 2.5.8 generated on January 11 2004
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright 2001,2002,2003 SolarMetric, Inc. All Rights Reserved.