aboutsummaryrefslogtreecommitdiff
path: root/src/common/Threading/LockedQueue.h
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2016-02-22 20:02:26 +0100
committerShauren <shauren.trinity@gmail.com>2016-02-22 20:02:26 +0100
commit8086a39210659c44d52fb463f5a39f047aa45685 (patch)
tree79cea67d774381245097ebed54c0963ddaef6cc6 /src/common/Threading/LockedQueue.h
parent346b9c1534644197846f32a11090fc82c84713f0 (diff)
Core/PacketIO: Requeue packets handled with STATUS_LOGGEDIN received before player is fully loaded in one step after packet processing loop - reduces used locks from 3 per packet to 1 per packet
Diffstat (limited to 'src/common/Threading/LockedQueue.h')
-rw-r--r--src/common/Threading/LockedQueue.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/common/Threading/LockedQueue.h b/src/common/Threading/LockedQueue.h
index c6faaaf81ca..21a29d7e53b 100644
--- a/src/common/Threading/LockedQueue.h
+++ b/src/common/Threading/LockedQueue.h
@@ -57,6 +57,14 @@ public:
unlock();
}
+ //! Adds items back to front of the queue
+ template<class Iterator>
+ void readd(Iterator begin, Iterator end)
+ {
+ std::lock_guard<std::mutex> lock(_lock);
+ _queue.insert(_queue.begin(), begin, end);
+ }
+
//! Gets the next result in the queue, if any.
bool next(T& result)
{