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); }
void GThread_OnNewGThread(GThread gThread) { this.CPUUsage.Add(gThread, gThread.GetCPUUsageRelative()); }
void GThread_OnEndGThread(GThread gThread) { this.CPUUsage.Remove(gThread); }