git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@609 331e1502-861f-0410-8da2-ba01fb791d7f
58 lines
775 B
C++
58 lines
775 B
C++
// "runner.h"
|
|
|
|
// (c) OPAC Team, LIFL, August 2005
|
|
|
|
/*
|
|
Contact: paradiseo-help@lists.gforge.inria.fr
|
|
*/
|
|
|
|
#ifndef __runner_h
|
|
#define __runner_h
|
|
|
|
#include <eoFunctor.h>
|
|
|
|
#include "communicable.h"
|
|
#include "thread.h"
|
|
|
|
typedef unsigned RUNNER_ID;
|
|
|
|
class Runner : public Communicable, public Thread {
|
|
|
|
public :
|
|
|
|
Runner ();
|
|
|
|
void start ();
|
|
|
|
void waitStarting ();
|
|
|
|
bool isLocal ();
|
|
|
|
void terminate ();
|
|
|
|
virtual void run () = 0;
|
|
|
|
RUNNER_ID getID ();
|
|
|
|
void packTermination ();
|
|
|
|
void notifySendingTermination ();
|
|
|
|
private :
|
|
|
|
sem_t sem_start;
|
|
|
|
unsigned id;
|
|
};
|
|
|
|
extern bool atLeastOneActiveRunner ();
|
|
|
|
extern void unpackTerminationOfRunner ();
|
|
|
|
extern Runner * getRunner (RUNNER_ID __key);
|
|
|
|
extern void startRunners ();
|
|
|
|
extern void joinRunners ();
|
|
|
|
#endif
|