]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/ipc/Coordinator.h
4 * DEBUG: section 54 Interprocess Communication
8 #ifndef SQUID_IPC_COORDINATOR_H
9 #define SQUID_IPC_COORDINATOR_H
14 #include "ipc/Messages.h"
19 /// Coordinates shared activities of Strands (Squid processes or threads)
20 class Coordinator
: public Port
23 static Coordinator
* Instance();
28 void broadcastSignal(int sig
) const; ///< send sig to registered strands
31 virtual void start(); // Port (AsyncJob) API
32 virtual void receive(const TypedMsgHdr
& message
); // Port API
34 StrandCoord
* findStrand(int kidId
); ///< registered strand or NULL
35 void registerStrand(const StrandCoord
&); ///< adds or updates existing
36 void handleRegistrationRequest(const StrandCoord
&); ///< register,ACK
39 typedef Vector
<StrandCoord
> Strands
; ///< unsorted strands
40 Strands strands
; ///< registered processes and threads
41 static Coordinator
* TheInstance
; ///< the only class instance in existence
43 CBDATA_CLASS2(Coordinator
);
46 Coordinator(const Coordinator
&); // not implemented
47 Coordinator
& operator =(const Coordinator
&); // not implemented
53 #endif /* SQUID_IPC_COORDINATOR_H */