JACK 5.4 Application Interface

aos.jack.util.thread
Class Semaphore

java.lang.Object
  extended byaos.jack.util.thread.Semaphore

public class Semaphore
extends java.lang.Object

Semaphore is a synchronisation resource to establish mutually exclusive regions of processing in JACK plans and threads. A Semaphore is a resource which plans and threads may wait for. On aquiring the semaphore the plan or thread will signal when they have completed. Waiting entities queue up on the semaphore and acquire it in FIFO order.


Constructor Summary
Semaphore()
          Constructs a Semaphore.
 
Method Summary
 Cursor planWait()
          Returns a Cursor object that can be used to determine when the semaphore is available and has been allocated to the caller.
 void signal()
          Releases the semaphore to next waiting thread or plan.
 void threadWait()
          Waits (using Object.wait()) until the semaphore is available.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Semaphore

public Semaphore()
Constructs a Semaphore. The Semaphore is initially allocated to the constructing thread (or plan), and must thus be released by an initial call to signal().

Method Detail

planWait

public Cursor planWait()
Returns a Cursor object that can be used to determine when the semaphore is available and has been allocated to the caller.


threadWait

public void threadWait()
Waits (using Object.wait()) until the semaphore is available.


signal

public void signal()
Releases the semaphore to next waiting thread or plan.


JACK 5.4 Application Interface

Copyright (C) 1999-2008, Agent Oriented Software Pty. Ltd.

US Government Restricted Rights
The JACK Modules and relevant Software Material have been developed entirely at private expense and are accordingly provided with RESTRICTED RIGHTS. Use, duplication, or disclosure by Government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of DFARS 252.227-7013 or subparagraph (c)(1) and (2) of the Commercial Computer Software Restricted Rights and 48 CFR 52.2270-19, as applicable.


Agent Oriented Software Pty. Ltd.     http://www.aosgrp.com
PO Box 639, Carlton South, Victoria 3053, Australia
Phone: +61 3 9349 5055, Fax: +61 3 9349 5088