httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stodd...@apache.org
Subject cvs commit: httpd-2.0/server/mpm/winnt mpm_winnt.c
Date Mon, 12 Mar 2001 17:37:04 GMT
stoddard    01/03/12 09:37:03

  Modified:    server/mpm/winnt mpm_winnt.c
  Log:
  Get rid of useless function call overhead.
  
  Revision  Changes    Path
  1.147     +4 -32     httpd-2.0/server/mpm/winnt/mpm_winnt.c
  
  Index: mpm_winnt.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/winnt/mpm_winnt.c,v
  retrieving revision 1.146
  retrieving revision 1.147
  diff -u -r1.146 -r1.147
  --- mpm_winnt.c	2001/03/12 17:28:55	1.146
  +++ mpm_winnt.c	2001/03/12 17:37:02	1.147
  @@ -194,34 +194,6 @@
       return APR_SUCCESS;
   }
   
  -/* A bunch or routines from os/win32/multithread.c that need to be merged into APR
  - * or thrown out entirely...
  - */
  -
  -static HANDLE create_semaphore(int initial)
  -{
  -    return(CreateSemaphore(NULL, initial, 1000000, NULL));
  -}
  -
  -static void acquire_semaphore(HANDLE semaphore_id)
  -{
  -    int rv;
  -    
  -    rv = WaitForSingleObject(semaphore_id, INFINITE);
  -    
  -    return;
  -}
  -
  -static int release_semaphore(HANDLE semaphore_id)
  -{
  -    return(ReleaseSemaphore(semaphore_id, 1, NULL));
  -}
  -
  -static void destroy_semaphore(HANDLE semaphore_id)
  -{
  -    CloseHandle(semaphore_id);
  -}
  -
   
   /* To share the semaphores with other processes, we need a NULL ACL
    * Code from MS KB Q106387
  @@ -546,7 +518,7 @@
       if (!allowed_globals.jobhead)
   	allowed_globals.jobhead = new_job;
       allowed_globals.jobcount++;
  -    release_semaphore(allowed_globals.jobsemaphore);
  +    ReleaseSemaphore(allowed_globals.jobsemaphore, 1, NULL);
   
       apr_lock_release(allowed_globals.jobmutex);
   }
  @@ -556,7 +528,7 @@
       joblist *job;
       int sock;
   
  -    acquire_semaphore(allowed_globals.jobsemaphore);
  +    WaitForSingleObject(allowed_globals.jobsemaphore, INFINITE);
       apr_lock_acquire(allowed_globals.jobmutex);
   
       if (shutdown_in_progress && !allowed_globals.jobhead) {
  @@ -1004,7 +976,7 @@
       ap_assert(maintenance_event);
   
       apr_pool_create(&pchild, pconf);
  -    allowed_globals.jobsemaphore = create_semaphore(0);
  +    allowed_globals.jobsemaphore = CreateSemaphore(NULL, 0, 1000000, NULL);
       apr_lock_create(&allowed_globals.jobmutex, APR_MUTEX, APR_INTRAPROCESS, NULL, pchild);
   
       /*
  @@ -1189,7 +1161,7 @@
       ap_log_error(APLOG_MARK,APLOG_INFO, APR_SUCCESS, server_conf, 
                    "Child %d: All worker threads have ended.", my_pid);
   
  -    destroy_semaphore(allowed_globals.jobsemaphore);
  +    CloseHandle(allowed_globals.jobsemaphore);
       apr_lock_destroy(allowed_globals.jobmutex);
       apr_lock_destroy(qlock);
   
  
  
  

Mime
View raw message