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());
 }
Ejemplo n.º 3
0
 protected static T NewTask()
 {
     lock (pool) {
         return(pool.GetObject());
     }
 }
Ejemplo n.º 4
0
 protected static T NewTask()
 {
     return(_pool.GetObject());
 }