Fixed potential coherency bug in timer code
authorJohn Hodge <[email protected]>
Sun, 4 Jul 2010 03:26:01 +0000 (11:26 +0800)
committerJohn Hodge <[email protected]>
Sun, 4 Jul 2010 03:26:01 +0000 (11:26 +0800)
Kernel/time.c

index c048d11..30d11dc 100644 (file)
@@ -43,6 +43,7 @@ void Timer_CallTimers()
 {
         int    i;
        void    (*callback)(void *);
+       void    *arg;
        
        for(i = 0;
                i < NUM_TIMERS;
@@ -50,9 +51,9 @@ void Timer_CallTimers()
        {
                if(gTimers[i].Callback == NULL) continue;
                if(giTimestamp < gTimers[i].FiresAfter) continue;
-               callback = gTimers[i].Callback;
+               callback = gTimers[i].Callback; arg = gTimers[i].Argument;
                gTimers[i].Callback = NULL;
-               callback(gTimers[i].Argument);
+               callback(arg);
        }
 }
 

UCC git Repository :: git.ucc.asn.au