]> git.ipfire.org Git - thirdparty/squid.git/blame - src/DiskIO/DiskThreads/CommIO.h
Boilerplate: update copyright blurbs on src/
[thirdparty/squid.git] / src / DiskIO / DiskThreads / CommIO.h
CommitLineData
bbc27441
AJ
1/*
2 * Copyright (C) 1996-2014 The Squid Software Foundation and contributors
3 *
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
7 */
8
1ff991dc
AJ
9#ifndef SQUID_SRC_DISKIO_DISKTHREADS_COMMIO_H
10#define SQUID_SRC_DISKIO_DISKTHREADS_COMMIO_H
56410c89 11
12#include "fde.h"
582c2af2 13#include "globals.h"
56410c89 14
15class CommIO
16{
17
18public:
19 static inline void NotifyIOCompleted();
20 static void ResetNotifications();
1564ff62 21 static void Initialize();
56410c89 22 static void NotifyIOClose();
23
24private:
25 static void NULLFDHandler(int, void *);
26 static void FlushPipe();
1564ff62 27 static bool Initialized;
56410c89 28 static bool DoneSignalled;
29 static int DoneFD;
30 static int DoneReadFD;
31};
32
45bb0381 33/* Inline code. TODO: make structured approach to inlining */
56410c89 34void
35CommIO::NotifyIOCompleted()
36{
1564ff62 37 if (!Initialized) {
45bb0381
AJ
38 fatalf("Disk Threads I/O pipes not initialized before first use.");
39 }
56410c89 40
41 if (!DoneSignalled) {
42 DoneSignalled = true;
43 FD_WRITE_METHOD(DoneFD, "!", 1);
44 }
45};
46
1ff991dc 47#endif /* SQUID_SRC_DISKIO_DISKTHREADS_COMMIO_H */