net.sf.magicproject.network
Class MMiniPipe

java.lang.Object
  extended by net.sf.magicproject.network.MMiniPipe

public class MMiniPipe
extends java.lang.Object

Since:
0.3
Author:
Fabrice Daugan

Constructor Summary
MMiniPipe()
          Create an instance of MMiniPipe initializing the token to free.
MMiniPipe(boolean taken)
          Create an instance of MMiniPipe initializing the token to the specified boolean.
 
Method Summary
 void release()
          Try to take this token.
 void take()
          Try to take this token.
 boolean takeNoBlock()
          Try to take this token.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MMiniPipe

public MMiniPipe()
Create an instance of MMiniPipe initializing the token to free. Means that the next call to method take() would'nt block the calling thread.

See Also:
take(), MMiniPipe(boolean)

MMiniPipe

public MMiniPipe(boolean taken)
Create an instance of MMiniPipe initializing the token to the specified boolean. Means that the next call to method take() would'nt block the calling thread only if the specified taken is false.

Parameters:
taken - one token critical resource
See Also:
take()
Method Detail

take

public void take()
Try to take this token. If the token is already token, the current thread would be blocked until a threadd release the requested token.


takeNoBlock

public boolean takeNoBlock()
Try to take this token. If the token is already token, the current thread would be blocked until a threadd release the requested token.

Returns:
true if has been token.

release

public void release()
Try to take this token. If the token is already token, the current thread would be blocked until a threadd release the requested token.



Copyright © 2003-2007 Magic-Project. All Rights Reserved.