< Previous by Date Date Index Next by Date >
  Thread Index Next in Thread >

[reSIProcate-users] ThreadIf


In the threadIf.cxx, I think below code is not necessary:    

DWORD exitCode;
   while (true)
   {
      if (GetExitCodeThread(mThread,&exitCode) != 0)
      {
         if (exitCode != STILL_ACTIVE)
         {
            break;
         }
         else
         {
            WaitForSingleObject(mThread,INFINITE);
         }
      }
      else
      {
         // log something here
         break;
      }
   }



This is enough:

WaitForSingleObject(mThread,INFINITE);