public void Wait(Mutex mutex) { LinkedListNode <ManualResetEvent> ev; lock (eventPool) { ev = eventPool.GetObject(); waitQueue.AddLast(ev); mutex.ReleaseMutex(); } ev.Value.WaitOne(); ev.Value.Reset(); lock (eventPool) { eventPool.ReturnObject(ev); } mutex.WaitOne(); }
public GameObject GetObject() { compactedSize = -1; return(pool.GetObject()); }
protected static T NewTask() { lock (pool) { return(pool.GetObject()); } }
protected static T NewTask() { return(_pool.GetObject()); }