]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Rename Ipc::FewToFewBiQueue method peek() to findOldest()
authorAlex Rousskov <rousskov@measurement-factory.com>
Thu, 27 Oct 2011 22:08:28 +0000 (16:08 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Thu, 27 Oct 2011 22:08:28 +0000 (16:08 -0600)
to better match the method functionality.

src/DiskIO/IpcIo/IpcIoFile.cc
src/ipc/Queue.h

index 3c8177069709b396ddbee2e3a731f28085e6958d..e27a167ad10ff95d6f517d4931e97b7be3c55d14 100644 (file)
@@ -362,7 +362,7 @@ IpcIoFile::canWait() const
         return true; // no timeout specified
 
     IpcIoMsg oldestIo;
-    if (!queue->peek(diskId, oldestIo) || oldestIo.start.tv_sec <= 0)
+    if (!queue->findOldest(diskId, oldestIo) || oldestIo.start.tv_sec <= 0)
         return true; // we cannot estimate expected wait time; assume it is OK
 
     const int oldestWait = tvSubMsec(oldestIo.start, current_time);
index c562379d5f140241fd53f9ae444dc7ec2af4ecaa..b9d6e2b3a403c03cde8c9075d69f3b19363c118a 100644 (file)
@@ -201,9 +201,9 @@ public:
     /// calls OneToOneUniQueue::push() using the given process queue
     template <class Value> bool push(const int remoteProcessId, const Value &value);
 
-    // TODO: rename to findOldest() or some such
-    /// calls OneToOneUniQueue::peek() using the given process queue
-    template<class Value> bool peek(const int remoteProcessId, Value &value) const;
+    /// finds the oldest item in incoming and outgoing queues between
+    /// us and the given remote process
+    template<class Value> bool findOldest(const int remoteProcessId, Value &value) const;
 
     /// returns true if pop() would have probably succeeded but does not pop()
     bool popReady() const;
@@ -367,7 +367,7 @@ FewToFewBiQueue::push(const int remoteProcessId, const Value &value)
 
 template <class Value>
 bool
-FewToFewBiQueue::peek(const int remoteProcessId, Value &value) const
+FewToFewBiQueue::findOldest(const int remoteProcessId, Value &value) const
 {
     // we may be called before remote process configured its queue end
     if (!validProcessId(remoteGroup(), remoteProcessId))