コード例 #1
0
ファイル: Async.cs プロジェクト: ExM/AsyncToolkit
 public static void Sleep(SleepSticker ss, int timeout, Action<bool> action)
 {
     RegisteredWaitHandle handle = null;
     handle = ThreadPool.RegisterWaitForSingleObject(ss.Wait, (object state, bool timedOut) =>
     {
         handle.Unregister(ss.Wait);
         action(timedOut);
     }, null, timeout, true);
 }
コード例 #2
0
        public static void Sleep(SleepSticker ss, int timeout, Action <bool> action)
        {
            RegisteredWaitHandle handle = null;

            handle = ThreadPool.RegisterWaitForSingleObject(ss.Wait, (object state, bool timedOut) =>
            {
                handle.Unregister(ss.Wait);
                action(timedOut);
            }, null, timeout, true);
        }