public void Run()
 {
     KProfiler.BeginThreadProfiling("KJobManager", thread.Name);
     while (true)
     {
         semaphore.WaitOne();
         if (jobManager.isShuttingDown)
         {
             break;
         }
         try
         {
             bool flag = true;
             while (flag)
             {
                 flag = jobManager.DoNextWorkItem();
             }
         }
         catch (Exception item)
         {
             exceptions.Add(item);
             errorOccured = true;
             Debugger.Break();
         }
         jobManager.DecrementActiveWorkerThreadCount();
     }
     KProfiler.EndThreadProfiling();
 }