]> granicus.if.org Git - apache/commitdiff
replaced APR_USEC_PER_SEC division with the new time macros
authorBrian Pane <brianp@apache.org>
Thu, 4 Jul 2002 22:41:48 +0000 (22:41 +0000)
committerBrian Pane <brianp@apache.org>
Thu, 4 Jul 2002 22:41:48 +0000 (22:41 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95959 13f79535-47bb-0310-9956-ffa450edef68

server/mpm/worker/worker.c
server/util_time.c

index 8d8575db7bb8b2e1f4fac1e9727ce3975b63e520..c9cec3f8539683b4da8f504508adceee4f8cacca 100644 (file)
@@ -991,7 +991,7 @@ static void create_listener_thread(thread_starter *ts)
          * XXX Jeff doesn't see how Apache is going to try to fork again since
          * the exit code is APEXIT_CHILDFATAL
          */
-        apr_sleep(10 * APR_USEC_PER_SEC);
+        apr_sleep(apr_time_from_sec(10));
         clean_child_exit(APEXIT_CHILDFATAL);
     }
     apr_os_thread_get(&listener_os_thread, ts->listener);
@@ -1072,7 +1072,7 @@ static void * APR_THREAD_FUNC start_threads(apr_thread_t *thd, void *dummy)
                 /* In case system resources are maxxed out, we don't want
                    Apache running away with the CPU trying to fork over and
                    over and over again if we exit. */
-                apr_sleep(10 * APR_USEC_PER_SEC);
+                apr_sleep(apr_time_from_sec(10));
                 clean_child_exit(APEXIT_CHILDFATAL);
             }
             threads_created++;
@@ -1086,7 +1086,7 @@ static void * APR_THREAD_FUNC start_threads(apr_thread_t *thd, void *dummy)
             break;
         }
         /* wait for previous generation to clean up an entry */
-        apr_sleep(1 * APR_USEC_PER_SEC);
+        apr_sleep(apr_time_from_sec(1));
         ++loops;
         if (loops % 120 == 0) { /* every couple of minutes */
             if (prev_threads_created == threads_created) {
@@ -1138,7 +1138,7 @@ static void join_workers(apr_thread_t *listener, apr_thread_t **threads)
 #endif
                == 0) {
             /* listener not dead yet */
-            apr_sleep(APR_USEC_PER_SEC / 2);
+            apr_sleep(apr_time_make(0, 500000));
             wakeup_listener();
             ++iter;
         }
@@ -1265,7 +1265,7 @@ static void child_main(int child_num_arg)
         /* In case system resources are maxxed out, we don't want
            Apache running away with the CPU trying to fork over and
            over and over again if we exit. */
-        apr_sleep(10 * APR_USEC_PER_SEC);
+        apr_sleep(apr_time_from_sec(10));
         clean_child_exit(APEXIT_CHILDFATAL);
     }
 
@@ -1367,7 +1367,7 @@ static int make_child(server_rec *s, int slot)
         /* In case system resources are maxxed out, we don't want
            Apache running away with the CPU trying to fork over and
            over and over again. */
-        apr_sleep(10 * APR_USEC_PER_SEC);
+        apr_sleep(apr_time_from_sec(10));
 
         return -1;
     }
index 48683a35c83c7d974bdcf1a67901cd5f795b8fe8..7b8447f5dbba841d55b64e5d1ba07a5933e08e43 100644 (file)
@@ -75,7 +75,7 @@ static apr_status_t cached_explode(apr_time_exp_t *xt, apr_time_t t,
                                    struct exploded_time_cache_element *cache,
                                    int use_gmt)
 {
-    apr_int64_t seconds = t / APR_USEC_PER_SEC;
+    apr_int64_t seconds = apr_time_sec(t);
     struct exploded_time_cache_element *cache_element =
         &(cache[seconds % TIME_CACHE_SIZE]);
     struct exploded_time_cache_element cache_element_snapshot;
@@ -157,7 +157,7 @@ static apr_status_t cached_explode(apr_time_exp_t *xt, apr_time_t t,
         memcpy(&(cache_element->xt), xt, sizeof(apr_time_exp_t));
         cache_element->t_validate = seconds;
     }
-    xt->tm_usec = (int)(t % APR_USEC_PER_SEC);
+    xt->tm_usec = (int)apr_time_usec(t);
     return APR_SUCCESS;
 }