1
0
mirror of https://github.com/lidgren/lidgren-network-gen3.git synced 2026-05-06 02:11:06 +09:00

NetQueue.TryDequeue failure will now only throw in DEBUG

WaitMessage will now create a wait event object if needed
This commit is contained in:
lidgren
2014-05-21 07:18:08 +00:00
parent 865a7600f2
commit fbddaf8962
3 changed files with 30 additions and 17 deletions

View File

@@ -193,6 +193,15 @@ namespace Lidgren.Network
return true;
}
catch
{
#if DEBUG
throw;
#else
item = default(T);
return false;
#endif
}
finally
{
m_lock.ExitWriteLock();
@@ -200,7 +209,7 @@ namespace Lidgren.Network
}
/// <summary>
/// Gets an item from the head of the queue, or returns default(T) if empty
/// Gets all items from the head of the queue, or returns number of items popped
/// </summary>
public int TryDrain(IList<T> addTo)
{