commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject cvs commit: jakarta-commons/daemon/src/native/nt/procrun procrun.c
Date Thu, 09 Oct 2003 07:16:09 GMT
mturk       2003/10/09 00:16:09

  Modified:    daemon/src/native/nt/procrun procrun.c
  Log:
  Remove the Sleep(xxx) calls for child sync, and use the
  true synchronization functions.
  
  Revision  Changes    Path
  1.9       +5 -3      jakarta-commons/daemon/src/native/nt/procrun/procrun.c
  
  Index: procrun.c
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/daemon/src/native/nt/procrun/procrun.c,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- procrun.c	4 Oct 2003 09:32:28 -0000	1.8
  +++ procrun.c	9 Oct 2003 07:16:09 -0000	1.9
  @@ -334,7 +334,8 @@
       GenerateConsoleCtrlEvent(CTRL_C_EVENT, child->dwProcessId);
       GenerateConsoleCtrlEvent(CTRL_BREAK_EVENT, child->dwProcessId);
   #if 1
  -    Sleep(2000);
  +    /* Wait for a child to capture CTRL_ events. */
  +    WaitForSingleObject(child->hThread, 2000);
   #endif
       if (!GetExitCodeProcess(child->hProcess, &stat) || 
           (stat != STILL_ACTIVE)) {
  @@ -1467,8 +1468,9 @@
   DWORD WINAPI wait_thread(LPVOID param)
   {
       procrun_t *env = (procrun_t *)param;
  -    
  -    Sleep(1000);
  +
  +    /* Wait util a process has finished its initialization. */
  +    WaitForInputIdle(env->c->pinfo.hProcess, INFINITE);
       WaitForSingleObject(env->c->pinfo.hThread, INFINITE);
       pool_close_handle(env->c->pool, env->c->pinfo.hThread);
       env->c->pinfo.hThread = NULL;
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message