コード例 #1
0
        public void CloseMe(RThread thread)
        {
            if (thread.id != null)
            {
                lock (threads)
                    threads.Remove(thread.id);
            }

            GC.Collect(0, GCCollectionMode.Forced);
            GC.WaitForPendingFinalizers();
        }
コード例 #2
0
        public void ExecuteGeneralTicks(Action action, int ticks, int tickWait = 1000, int wait = 0, object id = null)
        {
            RThread thread = new RThread();

            thread.type          = RThreadType.general_tick;
            thread.id            = id;
            thread.StartWait     = wait;
            thread.PerformAction = action;
            thread.Ticks         = ticks;
            thread.TickSleep     = tickWait;

            if (id != null)
            {
                threads.Add(thread.id, thread);
            }

            thread.Start();
        }
コード例 #3
0
        public void ExecuteActions(Action[] actions, int tickWait = 1000, int wait = 0, object id = null)
        {
            RThread thread = new RThread();

            thread.type           = RThreadType.actions;
            thread.id             = id;
            thread.StartWait      = wait;
            thread.PerformActions = actions;
            thread.Ticks          = actions.Length;
            thread.TickSleep      = tickWait;

            if (id != null)
            {
                threads.Add(thread.id, thread);
            }

            thread.Start();
        }
コード例 #4
0
        public void ExecuteGeneral(Action action, int wait = 0, object id = null)
        {
            RThread thread = new RThread();

            thread.type          = RThreadType.general;
            thread.id            = id;
            thread.StartWait     = wait;
            thread.PerformAction = action;

            if (id != null)
            {
                threads.Add(thread.id, thread);
            }

            thread.Start();

            Console.WriteLine("threads {0}", threads.Count);
        }