previous | start | next

Non-Preemptive Kernel Sync.

int x;

void AccessXThread()
{
    int oldIPL;
    oldIPL = setIPL(IHLevel);
    x = x + 1;
    setIPL(oldIPL);
}


void AccessXInterrupt()
{
   ...
   x = x + 1;
   ...
}      
   

For preemptive kernel, synchronization is more complicated.



previous | start | next