CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_7_hltpatch1/src/Fireworks/Core/interface/TRootXTReq.h

Go to the documentation of this file.
00001 // $Id: TRootXTReq.h,v 1.3 2011/01/24 17:44:21 amraktad Exp $
00002 
00003 #ifndef Fireworks_Core_TRootXTReq_h
00004 #define Fireworks_Core_TRootXTReq_h
00005 
00006 class TMutex;
00007 class TCondition;
00008 class TThread;
00009 
00010 class TTimer;
00011 class TSignalHandler;
00012 
00013 #include <TString.h>
00014 
00015 #include <list>
00016 #include <pthread.h>
00017 
00018 class TRootXTReq
00019 {
00020 private:
00021    typedef std::list<TRootXTReq*> lpXTReq_t;
00022 
00023    TCondition               *m_return_condition;
00024 
00025    static lpXTReq_t          sQueue;
00026    static pthread_t          sRootThread;
00027    static TMutex            *sQueueMutex;
00028    static TSignalHandler    *sSigHandler;
00029    static bool               sSheduled;
00030 
00031    virtual void Act() = 0;
00032 
00033 protected:
00034    TString                   mName;
00035 
00036    void post_request();
00037 
00038 public:
00039    TRootXTReq(const char* n="TRootXTReq");
00040    virtual ~TRootXTReq();
00041 
00042    void ShootRequest();
00043    void ShootRequestAndWait();
00044 
00045    // --- Static interface ---
00046 
00047    static void Bootstrap(pthread_t root_thread);
00048    static void Shutdown();
00049 
00050    static void ProcessQueue();
00051 
00052 };
00053 
00054 #endif