allow-rx-shutdown-for-userlevel-20010212
[openafs.git] / src / rx / rx_clock.c
index 4938035..546ae0f 100644 (file)
@@ -46,13 +46,13 @@ struct clock clock_now;             /* The last elapsed time ready by clock_GetTimer */
 int clock_haveCurrentTime;
 
 int clock_nUpdates;            /* The actual number of clock updates */
+static int clockInitialized = 0;
 
 /* Initialize the clock */
 void clock_Init(void) {
-    static initialized = 0;
     struct itimerval itimer, otimer;
 
-    if (!initialized) {
+    if (!clockInitialized) {
        itimer.it_value.tv_sec = STARTVALUE;
        itimer.it_value.tv_usec = 0;
        itimer.it_interval.tv_sec = 0;
@@ -64,12 +64,20 @@ void clock_Init(void) {
            fflush (stderr);
            exit(1);
        }
-       initialized = 1;
+       clockInitialized = 1;
     }
 
     clock_UpdateTime();
 }
 
+#ifndef KERNEL
+/* Make clock uninitialized. */
+clock_UnInit()
+{
+    clockInitialized = 0;
+} 
+#endif 
+
 /* Compute the current time.  The timer gets the current total elapsed time since startup, expressed in seconds and microseconds.  This call is almost 200 usec on an APC RT */
 void clock_UpdateTime()
 {