]> granicus.if.org Git - apache/commitdiff
Support non-threaded operation, for the most part. The code still
authorManoj Kasichainula <manoj@apache.org>
Thu, 29 Jul 1999 20:43:28 +0000 (20:43 +0000)
committerManoj Kasichainula <manoj@apache.org>
Thu, 29 Jul 1999 20:43:28 +0000 (20:43 +0000)
references pthread calls, but they are essentially no-ops in the
non-threaded case; these can be #defined or wrapped away.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@83530 13f79535-47bb-0310-9956-ffa450edef68

server/mpm/mpmt_pthread/mpm_default.h
server/mpm/mpmt_pthread/mpmt_pthread.c

index 32c70bb74e8cb9ffafa267d8c391c08b9f167cd4..538af6b83662a8367b76ab163754b12f9ff34d41 100644 (file)
@@ -90,6 +90,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
  * 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
 
+#ifdef NO_THREADS
+#define DEFAULT_THREADS_PER_CHILD 1
+#endif
 #ifndef DEFAULT_THREADS_PER_CHILD
 #define DEFAULT_THREADS_PER_CHILD 50
 #endif
index 34ecea29971820838476eef2706ced620db21f7b..49fd45af303f51d4d1fb1df1e9d54aabee7afd59 100644 (file)
@@ -1052,6 +1052,7 @@ static void child_main(int child_num_arg)
        /* 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");
@@ -1061,6 +1062,11 @@ static void child_main(int child_num_arg)
             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.
@@ -1125,9 +1131,7 @@ static int make_child(server_rec *s, int slot, time_t now) /* ZZZ */
 
         RAISE_SIGSTOP(MAKE_CHILD);
 
-       /* XXX - For an unthreaded server, a signal handler will be necessary
         signal(SIGTERM, just_die);
-       */
         child_main(slot);
 
        return 0;