public void Enqueue( Event e ) { lock( this ) { this.queue.Enqueue( e ); Monitor.Pulse( this ); } }
public void Enqueue( Event e ) { lock( this.syncRoot ) { this.queue.Enqueue( e ); Monitor.Pulse( this.syncRoot ); } if ( this.synchronousEventSent != null && e.IsSynchronous ) { this.synchronousEventSent.WaitOne(); } else { Thread.Sleep( 0 ); // give EventPump thread a chance to process the event } }