Exemple #1
0
        public static ThreadedActionInvoker AtDelay(this int ms, ThreadedAction handler)
        {
            var x = handler.ToThreadedActionInvoker();

            x.Delay = ms;

            x.Thread.Name         = "AtDelay " + ms;
            x.Thread.IsBackground = true;
            x.Thread.Start();

            return(x);
        }
Exemple #2
0
        public static void WithTimeout(this int ms, ThreadedAction handler)
        {
            var x = handler.ToThreadedActionInvoker();

            x.Delay = 0;

            x.Thread.Name         = "WithTimeout " + ms;
            x.Thread.IsBackground = true;
            x.Thread.Start();

            if (x.Thread.Join(ms))
            {
                return;
            }


            x.Thread.Abort();
        }
		public static ThreadedActionInvoker AtDelay(this int ms, ThreadedAction handler)
		{
			var x = handler.ToThreadedActionInvoker();

			x.Delay = ms;

			x.Thread.Name = "AtDelay " + ms; 
			x.Thread.IsBackground = true;
			x.Thread.Start();

			return x;
		}
		public static void WithTimeout(this int ms, ThreadedAction handler)
		{
			var x = handler.ToThreadedActionInvoker();

			x.Delay = 0;

			x.Thread.Name = "WithTimeout " + ms;
			x.Thread.IsBackground = true;
			x.Thread.Start();

			if (x.Thread.Join(ms))
				return;

			
			x.Thread.Abort();
		}