- Main Page
- Namespaces
- Classes
- Files

- Search for |

# thread.h

    00001 // "thread.h"
    00002
    00003 // (c) OPAC Team, LIFL, August 2005
    00004
    00005 /*
    00006    Contact: paradiseo-help@lists.gforge.inria.fr
    00007 */
    00008
    00009 #ifndef THREAD_H_
    00010 #define THREAD_H_
    00011
    00012 #include <vector>
    00013
    00014 /* A high-level thread */
    00015
    00016 class Thread {
    00017
    00018 public:
    00019
    00020   /* Ctor */
    00021   Thread ();
    00022
    00023   /* Dtor */
    00024   virtual ~ Thread ();
    00025
    00026   /* Go ! */
    00027   virtual void start () = 0;
    00028
    00029   void setActive ();/* It means the current process is going to send messages soon */
    00030   void setPassive ();/* The current process is not going to perform send operations
    00031                         (but it may receive messages) */
    00032
    00033 private :
    00034
    00035   bool act;
    00036 };
    00037
    00038 extern void addThread (Thread * __hl_thread, std :: vector <pthread_t *> & __ll_threads);
    00039
    00040 extern void joinThreads (std :: vector <pthread_t *> & __ll_threads);
    00041
    00042 extern bool atLeastOneActiveThread (); /* It returns 'true' iff at least one process is going
    00043                                       to send messages */
    00044
    00045 extern unsigned numberOfActiveThreads ();
    00046
    00047
    00048 #endif /*THREAD_H_*/