]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/DiskIO/DiskThreads/CommIO.cc
2 * Copyright (C) 1996-2015 The Squid Software Foundation and contributors
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.
9 /* DEBUG: section 05 Disk I/O pipe manager */
12 #include "comm/Loops.h"
13 #include "DiskIO/DiskThreads/CommIO.h"
21 if (CommIO::Initialized
)
24 /* Initialize done pipe signal */
26 if (pipe(DonePipe
)) {}
28 DoneReadFD
= DonePipe
[0];
29 fd_open(DoneReadFD
, FD_PIPE
, "async-io completion event: main");
30 fd_open(DoneFD
, FD_PIPE
, "async-io completion event: threads");
31 commSetNonBlocking(DoneReadFD
);
32 commSetNonBlocking(DoneFD
);
33 Comm::SetSelect(DoneReadFD
, COMM_SELECT_READ
, NULLFDHandler
, NULL
, 0);
38 CommIO::NotifyIOClose()
40 /* Close done pipe signal */
49 bool CommIO::Initialized
= false;
50 bool CommIO::DoneSignalled
= false;
51 int CommIO::DoneFD
= -1;
52 int CommIO::DoneReadFD
= -1;
58 FD_READ_METHOD(DoneReadFD
, buf
, sizeof(buf
));
62 CommIO::NULLFDHandler(int fd
, void *)
65 Comm::SetSelect(fd
, COMM_SELECT_READ
, NULLFDHandler
, NULL
, 0);
69 CommIO::ResetNotifications()
73 DoneSignalled
= false;