tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
Date Thu, 04 Jul 2002 12:44:56 GMT
mturk       2002/07/04 05:44:56

  Modified:    jk/native2/server/isapi jk_isapi_plugin.c
  Log:
  Use the WaitForSingleObject instead of GetThreatExitCode.
  There was a bug that caused terminating the starter thread
  before the entire clenup finished.
  The entire extinsion start/stop management is now done in a
  separate thread.
  
  Revision  Changes    Path
  1.33      +17 -29    jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c
  
  Index: jk_isapi_plugin.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- jk_isapi_plugin.c	4 Jul 2002 07:23:55 -0000	1.32
  +++ jk_isapi_plugin.c	4 Jul 2002 12:44:56 -0000	1.33
  @@ -521,28 +521,17 @@
   }
   
   HANDLE jk2_starter_event;
  +HANDLE jk2_starter_thread = NULL;
   
   BOOL WINAPI TerminateFilter(DWORD dwFlags) 
   {
       /* detatch the starter thread */
       SetEvent(jk2_starter_event);
  -
  -    if (is_inited) {
  -        is_inited = JK_FALSE;
  -        if (workerEnv) {
  -            jk_env_t *env = workerEnv->globalEnv;
  -            workerEnv->close(env, workerEnv);
  -        }
  -        apr_pool_destroy(jk_globalPool);
  -        workerEnv=NULL;
  -        is_mapread = JK_FALSE;
  -    }
  +    WaitForSingleObject(jk2_starter_thread, 3000);
       return TRUE;
   }
   
   
  -HANDLE jk2_starter_thread = NULL;
  -
   DWORD WINAPI jk2_isapi_starter( LPVOID lpParam ) 
   { 
       Sleep(1000);
  @@ -552,7 +541,17 @@
           if (init_jk(NULL))
               is_mapread = JK_TRUE;
       }
  +
       WaitForSingleObject(jk2_starter_event, INFINITE);
  +
  +    if (is_inited) {
  +        is_inited = JK_FALSE;
  +        if (workerEnv) {
  +            jk_env_t *env = workerEnv->globalEnv;
  +            workerEnv->close(env, workerEnv);
  +        }
  +        is_mapread = JK_FALSE;
  +    }
       return 0; 
   } 
   
  @@ -566,25 +565,17 @@
       char dir[_MAX_DIR];
       char fname[_MAX_FNAME];
       DWORD dwThreadId;
  -    DWORD dwRes;
  -    int tcount = 0;
   
       switch (ulReason) {
           case DLL_PROCESS_DETACH:
  -            while (!GetExitCodeThread(jk2_starter_thread, &dwRes)) {
  -                if (dwRes == STILL_ACTIVE) {
  -                    ++tcount;
  -                    if (tcount > 30) {
  -                        TerminateThread(jk2_starter_thread, -1);
  -                        break;
  -                    }
  -                    Sleep(100);
  -                }
  -            }
  +            WaitForSingleObject(jk2_starter_thread, INFINITE);
               CloseHandle(jk2_starter_thread);
  +            apr_terminate();
           break;
   
           case DLL_PROCESS_ATTACH:
  +            apr_initialize();
  +            apr_pool_create( &jk_globalPool, NULL );
               if (GetModuleFileName( hInst, file_name, sizeof(file_name))) {
                   _splitpath( file_name, drive, dir, fname, NULL );
                   _makepath( ini_file_name, drive, dir, fname, ".properties" );
  @@ -754,9 +745,6 @@
       jk_pool_t *globalPool;
       jk_bean_t *jkb;
       jk_env_t *env;
  -
  -    apr_initialize();
  -    apr_pool_create( &jk_globalPool, NULL );
   
       jk2_pool_apr_create( NULL, &globalPool, NULL, jk_globalPool );
   
  
  
  

--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message