pthread_mutex_lock(&ThreadCountMutex);
--active_workers;
- if ( (active_workers + CtdlGetConfigInt("c_min_workers") < num_workers)
- && (num_workers > CtdlGetConfigInt("c_min_workers"))
- ) {
- num_workers--;
- pthread_mutex_unlock(&ThreadCountMutex);
- return (NULL);
- }
pthread_mutex_unlock(&ThreadCountMutex);
}
// If control reaches this point, the server is shutting down
- pthread_mutex_lock(&ThreadCountMutex);
- --num_workers;
- pthread_mutex_unlock(&ThreadCountMutex);
- return(NULL);
+ while(1) {
+ sleep(1); // wait to die
+ }
+ //pthread_mutex_lock(&ThreadCountMutex);
+ //--num_workers;
+ //pthread_mutex_unlock(&ThreadCountMutex);
+ //return(NULL);
}