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
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);
}
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) {
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);
/*
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);