예제 #1
0
        public static GThread GetCurrentGThread()
        {
            Thread currentThread = Thread.CurrentThread;

            foreach (GThread gThread in AllGThreads)
            {
                if (gThread.Thread == currentThread)
                {
                    return(gThread);
                }
            }

            GThread gthread = new GThread();

            gthread._thread        = currentThread;
            gthread._processThread = GThread.GetCurrentProcessThread();
            gthread.Name           = GCore.Sys.Process.Utils.GetLastMethodName();
            AllGThreads.Add(gthread);
            return(gthread);
        }
예제 #2
0
 void GThread_OnNewGThread(GThread gThread)
 {
     this.CPUUsage.Add(gThread, gThread.GetCPUUsageRelative());
 }
예제 #3
0
 void GThread_OnEndGThread(GThread gThread)
 {
     this.CPUUsage.Remove(gThread);
 }