manoj 99/07/29 13:11:43
Modified: pthreads/src/include httpd.h pthreads/src/main http_main.c Log: Support non-threaded operation, for the most part. The code still references pthread calls, but they are essentially no-ops in the non-threaded case; these can be #defined or wrapped away. Revision Changes Path 1.19 +9 -0 apache-apr/pthreads/src/include/httpd.h Index: httpd.h =================================================================== RCS file: /home/cvs/apache-apr/pthreads/src/include/httpd.h,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -u -r1.18 -r1.19 --- httpd.h 1999/06/29 00:18:03 1.18 +++ httpd.h 1999/07/29 20:11:41 1.19 @@ -306,6 +306,9 @@ * enough that we can read the whole thing without worrying too much about * the overhead. */ +#ifdef NO_THREADS +#define HARD_SERVER_LIMIT 256 +#endif #ifndef HARD_SERVER_LIMIT #define HARD_SERVER_LIMIT 8 #endif @@ -317,6 +320,9 @@ * enough that we can read the whole thing without worrying too much about * the overhead. */ +#ifdef NO_THREADS +#define HARD_THREAD_LIMIT 1 +#endif #ifndef HARD_THREAD_LIMIT #define HARD_THREAD_LIMIT 64 #endif @@ -366,6 +372,9 @@ #define DEFAULT_MAX_REQUESTS_PER_CHILD 10000 #endif +#ifdef NO_THREADS +#define DEFAULT_THREADS_PER_CHILD 1 +#endif #ifndef DEFAULT_THREADS_PER_CHILD #define DEFAULT_THREADS_PER_CHILD 50 #endif 1.96 +6 -0 apache-apr/pthreads/src/main/http_main.c Index: http_main.c =================================================================== RCS file: /home/cvs/apache-apr/pthreads/src/main/http_main.c,v retrieving revision 1.95 retrieving revision 1.96 diff -u -d -u -r1.95 -r1.96 --- http_main.c 1999/07/19 03:51:55 1.95 +++ http_main.c 1999/07/29 20:11:42 1.96 @@ -1884,6 +1884,7 @@ /* We are creating threads right now */ (void) ap_update_child_status(my_child_num, i, SERVER_STARTING, (request_rec *) NULL); +#ifndef NO_THREADS if (pthread_create(&thread, &thread_attr, worker_thread, my_info)) { ap_log_error(APLOG_MARK, APLOG_ALERT, server_conf, "pthread_create: unable to create worker thread"); @@ -1893,6 +1894,11 @@ sleep(10); clean_child_exit(APEXIT_CHILDFATAL); } +#else + worker_thread(my_info); + /* The SIGTERM shouldn't let us reach this point, but just in case... */ + clean_child_exit(APEXIT_OK); +#endif /* We let each thread update it's own scoreboard entry. This is done * because it let's us deal with tid better.