Esempio n. 1
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);
 }
Esempio n. 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);
        }