Esempio n. 1
0
        static DelayedTask()
        {
            System.Threading.Interlocked.CompareExchange(ref SyncRoot, new object(), null);

            taskObjects = new ConcurrentDictionary<uint, DelayedAction>();
            baseThread = new BaseThread(new ThreadAction(() =>
                                                         {
                                                         	foreach (DelayedAction action in taskObjects.Values)
                                                         	{
                                                         		try
                                                         		{
                                                         			action.threadAction.Invoke();
                                                         		}
                                                         		catch (Exception e) { Console.WriteLine(e.ToString()); }
                                                         	}
                                                         }), 100, "DelayedTask");
            baseThread.Start();
        }
Esempio n. 2
0
        static DelayedTask()
        {
            System.Threading.Interlocked.CompareExchange(ref SyncRoot, new object(), null);

            taskObjects = new ConcurrentDictionary <uint, DelayedAction>();
            baseThread  = new BaseThread(new ThreadAction(() =>
            {
                foreach (DelayedAction action in taskObjects.Values)
                {
                    try
                    {
                        action.threadAction.Invoke();
                    }
                    catch (Exception e) { Console.WriteLine(e.ToString()); }
                }
            }), 100, "DelayedTask");
            baseThread.Start();
        }