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

(cherry picked from commit 8086a39210)
This commit is contained in:
Shauren
2016-02-22 20:02:26 +01:00
parent 67aa8cabce
commit 9fc5c4bc41
2 changed files with 13 additions and 12 deletions

View File

@@ -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)
{