PenProfile 2.x

com.sun.cldc.util
Class Semaphore

java.lang.Object
  extended by com.sun.cldc.util.Semaphore

public class Semaphore
extends Object


Constructor Summary
Semaphore(int permits)
          Creates a Semaphore with the given number of permits.
 
Method Summary
 void acquire()
          Acquires a permit from this semaphore, blocking until one is available.
 void release()
          Releases a permit, returning it to the semaphore.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Semaphore

public Semaphore(int permits)
Creates a Semaphore with the given number of permits.

Method Detail

acquire

public void acquire()
Acquires a permit from this semaphore, blocking until one is available.


release

public void release()
Releases a permit, returning it to the semaphore. If any threads are blocking trying to acquire a permit, then one is selected and given the permit that was just released. That thread is re-enabled for thread scheduling purposes.


PenProfile 2.x

Copyright © 2010 Livescribe Inc. All Rights Reserved.
Confidential and subject to NDA.