diff options
author | Spp <spp@jorge.gr> | 2011-12-27 10:05:49 +0100 |
---|---|---|
committer | Spp <spp@jorge.gr> | 2011-12-27 10:15:27 +0100 |
commit | fa9daaf95b9f09f3a442087cbc59abc782814c63 (patch) | |
tree | c24fe99837993c101de77df1416fde629c993817 /src/server/shared/Threading/LockedQueue.h | |
parent | 8323027e0c15e97e5da5ec0948c447273321d43f (diff) | |
parent | 317628902462c371dc29ec984803fbfb6412402c (diff) |
Merge branch 'master' into 4.x and some warning fixes
Diffstat (limited to 'src/server/shared/Threading/LockedQueue.h')
-rwxr-xr-x | src/server/shared/Threading/LockedQueue.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/server/shared/Threading/LockedQueue.h b/src/server/shared/Threading/LockedQueue.h index 92eab440684..4d2ddd33f5f 100755 --- a/src/server/shared/Threading/LockedQueue.h +++ b/src/server/shared/Threading/LockedQueue.h @@ -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; } |