org.objectweb.proactive.core.util
Interface ThreadStore

All Known Implementing Classes:
ThreadStoreImpl

public interface ThreadStore

A class implementing this interface provides a sort of store where threads like customers can enter and exit. The store can open and close. The rule are that no thread can enter when the store is closed and that the store cannot close until all threads already inside exit. Like in any other stores, once the store is closing, no more Thread can enter.

Since:
ProActive 0.9.2
Version:
1.0, 2002/05
Author:
ProActive Team

Method Summary
 void close()
          Closes the store.
 void enter()
          Signals that a thread wants to enter the store.
 void exit()
          Signals that a thread exited the store.
 void open()
          Opens the store.
 int threadCount()
          Returns how many threads are in the store.
 

Method Detail

threadCount

int threadCount()
Returns how many threads are in the store. This method is non blocking.

Returns:
how many threads are in the store.

enter

void enter()
Signals that a thread wants to enter the store. If the store is opened the call is non blocking. If the store is closed or closing the call is blocking until the store opens.


exit

void exit()
Signals that a thread exited the store. The call is non blocking.


close

void close()
Closes the store. The call is blocking until all threads currently in the store exit. No other thread can enter the store after this call. Therefore the store can be closing or closed.


open

void open()
Opens the store. The call is non blocking. It allows the thread waiting to enter the store to proceed.



Copyright 2001-2007 INRIA All Rights Reserved.