TRootXTReq

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51

#ifndef Fireworks_Core_TRootXTReq_h
#define Fireworks_Core_TRootXTReq_h

class TMutex;
class TCondition;
class TThread;

class TTimer;
class TSignalHandler;

#include <TString.h>

#include <list>
#include <pthread.h>

class TRootXTReq {
private:
  typedef std::list<TRootXTReq *> lpXTReq_t;

  TCondition *m_return_condition;

  static lpXTReq_t sQueue;
  static pthread_t sRootThread;
  static TMutex *sQueueMutex;
  static TSignalHandler *sSigHandler;
  static bool sSheduled;

  virtual void Act() = 0;

protected:
  TString mName;

  void post_request();

public:
  TRootXTReq(const char *n = "TRootXTReq");
  virtual ~TRootXTReq();

  void ShootRequest();
  void ShootRequestAndWait();

  // --- Static interface ---

  static void Bootstrap(pthread_t root_thread);
  static void Shutdown();

  static void ProcessQueue();
};

#endif