]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/DiskIO/IpcIo/IpcIoFile.h
Docs: Copyright updates for 2018 (#114)
[thirdparty/squid.git] / src / DiskIO / IpcIo / IpcIoFile.h
index 3a43d593650118f3bd1c8ee329e30b13312ecd91..f89197ed82c7add134effb1a02b047f9eeee04fc 100644 (file)
@@ -1,3 +1,11 @@
+/*
+ * Copyright (C) 1996-2018 The Squid Software Foundation and contributors
+ *
+ * Squid software is distributed under GPLv2+ license and includes
+ * contributions from numerous individuals and organizations.
+ * Please see the COPYING and CONTRIBUTORS files for details.
+ */
+
 #ifndef SQUID_IPC_IOFILE_H
 #define SQUID_IPC_IOFILE_H
 
@@ -7,6 +15,7 @@
 #include "DiskIO/IORequestor.h"
 #include "ipc/forward.h"
 #include "ipc/mem/Page.h"
+#include "SquidString.h"
 #include <list>
 #include <map>
 #include <memory>
@@ -25,7 +34,6 @@ typedef enum { cmdNone, cmdOpen, cmdRead, cmdWrite } Command;
 
 } // namespace IpcIo
 
-
 /// converts DiskIO requests to IPC queue messages
 class IpcIoMsg
 {
@@ -49,6 +57,7 @@ class IpcIoPendingRequest;
 
 class IpcIoFile: public DiskFile
 {
+    CBDATA_CLASS(IpcIoFile);
 
 public:
     typedef RefCount<IpcIoFile> Pointer;
@@ -85,7 +94,7 @@ protected:
     bool canWait() const;
 
 private:
-    void trackPendingRequest(IpcIoPendingRequest *const pending);
+    void trackPendingRequest(const unsigned int id, IpcIoPendingRequest *const pending);
     void push(IpcIoPendingRequest *const pending);
     IpcIoPendingRequest *dequeueRequest(const unsigned int requestId);
 
@@ -102,6 +111,7 @@ private:
     static void DiskerHandleMoreRequests(void*);
     static void DiskerHandleRequests();
     static void DiskerHandleRequest(const int workerId, IpcIoMsg &ipcIo);
+    static bool WaitBeforePop();
 
 private:
     const String dbName; ///< the name of the file we are managing
@@ -130,15 +140,12 @@ private:
     static IpcIoFilesMap IpcIoFiles;
 
     typedef Ipc::FewToFewBiQueue Queue;
-    static std::auto_ptr<Queue> queue; ///< IPC queue
+    static std::unique_ptr<Queue> queue; ///< IPC queue
 
     /// whether we are waiting for an event to handle still queued I/O requests
     static bool DiskerHandleMoreRequestsScheduled;
-
-    CBDATA_CLASS2(IpcIoFile);
 };
 
-
 /// keeps original I/O request parameters while disker is handling the request
 class IpcIoPendingRequest
 {
@@ -158,5 +165,5 @@ private:
     IpcIoPendingRequest &operator =(const IpcIoPendingRequest &d); // ditto
 };
 
-
 #endif /* SQUID_IPC_IOFILE_H */
+