CommIO.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2017 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 
9 #ifndef SQUID_SRC_DISKIO_DISKTHREADS_COMMIO_H
10 #define SQUID_SRC_DISKIO_DISKTHREADS_COMMIO_H
11 
12 #include "fatal.h"
13 #include "fde.h"
14 #include "globals.h"
15 
16 class CommIO
17 {
18 
19 public:
20  static inline void NotifyIOCompleted();
21  static void ResetNotifications();
22  static void Initialize();
23  static void NotifyIOClose();
24 
25 private:
26  static void NULLFDHandler(int, void *);
27  static void FlushPipe();
28  static bool Initialized;
29  static bool DoneSignalled;
30  static int DoneFD;
31  static int DoneReadFD;
32 };
33 
34 /* Inline code. TODO: make structured approach to inlining */
35 void
37 {
38  if (!Initialized) {
39  fatalf("Disk Threads I/O pipes not initialized before first use.");
40  }
41 
42  if (!DoneSignalled) {
43  DoneSignalled = true;
44  FD_WRITE_METHOD(DoneFD, "!", 1);
45  }
46 };
47 
48 #endif /* SQUID_SRC_DISKIO_DISKTHREADS_COMMIO_H */
49 
static void ResetNotifications()
Definition: CommIO.cc:69
static bool DoneSignalled
Definition: CommIO.h:29
static bool Initialized
Definition: CommIO.h:28
static void NULLFDHandler(int, void *)
Definition: CommIO.cc:62
static int DoneReadFD
Definition: CommIO.h:31
static void NotifyIOClose()
Definition: CommIO.cc:38
Definition: CommIO.h:16
void fatalf(const char *fmt,...)
Definition: fatal.cc:79
static int DoneFD
Definition: CommIO.h:30
static void NotifyIOCompleted()
Definition: CommIO.h:36
static void Initialize()
Definition: CommIO.cc:19
static void FlushPipe()
Definition: CommIO.cc:55
#define FD_WRITE_METHOD(fd, buf, len)
Definition: fde.h:162

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors