GailTestApp.MovingThread.CallDelegInMainLoop C# (CSharp) 메소드

CallDelegInMainLoop() 공개 메소드

public CallDelegInMainLoop ( System d ) : EventWaitHandle
d System
리턴 System.Threading.EventWaitHandle
		public EventWaitHandle CallDelegInMainLoop (System.Action d)
		{
			exceptionHappened = null;
			EventWaitHandle wakeUpInMainLoop = new AutoResetEvent (false);
			lock (this.forState) { 
				if (this.internalState != ThreadState.Running)
					throw new NotSupportedException ("The Mainloop is not running yet.");
				lastHandle = wakeUpInMainLoop;
			}
			try {
				return wakeUpInMainLoop;
			}
			finally {
				Gtk.Application.Invoke ( delegate { d (); wakeUpInMainLoop.Set (); });
			}
		}

Usage Example

예제 #1
0
파일: Main.cs 프로젝트: wilson1011/uia2atk
        public static void Kill(MovingThread thread)
        {
            EventWaitHandle wh = thread.CallDelegInMainLoop(KillMe);

            wh.WaitOne();
            if (thread.ExceptionHappened != null)
            {
                throw thread.ExceptionHappened;
            }
            wh.Close();
        }
All Usage Examples Of GailTestApp.MovingThread::CallDelegInMainLoop