Fixed potential coherency bug in timer code
[tpg/acess2.git] / 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