public void finish(EventHandler handler) { lock (this) { Debug.Assert(!_destroyed); handler._registered = SocketOperation.None; // // If there are no pending asynchronous operations, we can call finish on the handler now. // if (handler._pending == 0) { executeNonBlocking(() => { ThreadPoolCurrent current = new ThreadPoolCurrent(this, handler, SocketOperation.None); handler.finished(ref current); }); } else { handler._finish = true; } } }
public void finish(EventHandler handler) { _m.Lock(); try { Debug.Assert(!_destroyed); if (handler._pending == 0) { handler._registered = SocketOperation.None; executeNonBlocking(delegate() { ThreadPoolCurrent current = new ThreadPoolCurrent(this, handler, SocketOperation.None); handler.finished(ref current); }); } else { handler._finish = true; } } finally { _m.Unlock(); } }
public void finish(EventHandler handler) { lock(this) { Debug.Assert(!_destroyed); // // If there are no pending asynchronous operations, we can call finish on the handler now. // if(handler._pending == 0) { handler._registered = SocketOperation.None; executeNonBlocking(() => { ThreadPoolCurrent current = new ThreadPoolCurrent(this, handler, SocketOperation.None); handler.finished(ref current); }); } else { handler._finish = true; } } }
public void finish(EventHandler handler) { _m.Lock(); try { Debug.Assert(!_destroyed); if(handler._pending == 0) { handler._registered = SocketOperation.None; executeNonBlocking(delegate() { ThreadPoolCurrent current = new ThreadPoolCurrent(this, handler, SocketOperation.None); handler.finished(ref current); }); } else { handler._finish = true; } } finally { _m.Unlock(); } }