Core/Netcode: Fix a possible infinite loop after 829be0b82 (which was accidentally merged in this morning)

This commit is contained in:
Machiavelli committed 2011-12-19 21:12:35 +01:00
1 parent d1378a9c94
commit 8e0be985fd
2 files changed
+19 -4

No files matched your search

+5 -2
View File
@@ -98,13 +98,16 @@ namespace ACE_Based
return true;
}
//! Peeks at the top of the queue. Remember to unlock after use.
T& peek()
//! Peeks at the top of the queue. Check if the queue is empty before calling! Remember to unlock after use if autoUnlock == false.
T& peek(bool autoUnlock = false)
{
lock();
T& result = _queue.front();
if (autoUnlock)
unlock();
return result;
}