Back to index

nordugrid-arc-nox  1.1.0~rc6
commfifo.h
Go to the documentation of this file.
00001 #include <list>
00002 
00003 #include <arc/Thread.h>
00004 #include "users.h"
00005 
00006 class CommFIFOListener;
00007 
00008 class CommFIFO {
00009  private:
00010   class elem_t {
00011    public:
00012     elem_t(void):user(NULL),fd(-1),fd_keep(-1) { };
00013     JobUser* user;
00014     int fd;
00015     int fd_keep;
00016   };
00017   std::list<elem_t> fds;
00018   int kick_in;
00019   int kick_out;
00020   Glib::Mutex lock;
00021   int timeout_;
00022  public:
00023   CommFIFO(void);
00024   ~CommFIFO(void);
00025   bool add(JobUser& user);
00026   JobUser* wait(int timeout);
00027   JobUser* wait(void) { return wait(timeout_); };
00028   void timeout(int t) { timeout_=t; };
00029 };
00030 
00031 bool SignalFIFO(const JobUser& user);
00032 bool PingFIFO(const JobUser& user);
00033