]> git.ipfire.org Git - thirdparty/squid.git/blob - src/DiskIO/DiskThreads/CommIO.h
Enable source-formatting tools to collapse multiple whitelines in the source to one.
[thirdparty/squid.git] / src / DiskIO / DiskThreads / CommIO.h
1 #ifndef SQUID_SRC_DISKIO_DISKTHREADS_COMMIO_H
2 #define SQUID_SRC_DISKIO_DISKTHREADS_COMMIO_H
3
4 #include "fde.h"
5 #include "globals.h"
6
7 class CommIO
8 {
9
10 public:
11 static inline void NotifyIOCompleted();
12 static void ResetNotifications();
13 static void Initialise();
14 static void NotifyIOClose();
15
16 private:
17 static void NULLFDHandler(int, void *);
18 static void FlushPipe();
19 static bool Initialised;
20 static bool DoneSignalled;
21 static int DoneFD;
22 static int DoneReadFD;
23 };
24
25
26 /* Inline code. TODO: make structued approach to inlining */
27 void
28 CommIO::NotifyIOCompleted()
29 {
30 if (!Initialised)
31 Initialise();
32
33 if (!DoneSignalled) {
34 DoneSignalled = true;
35 FD_WRITE_METHOD(DoneFD, "!", 1);
36 }
37 };
38
39 #endif /* SQUID_SRC_DISKIO_DISKTHREADS_COMMIO_H */