Thursday, August 05, 2004

kernel syncronization

You can use the macros DECLARE_MUTEX and DECLARE_MUTEX_LOCKED

to declare semaphores with initial values of 1 or 0. You can
then use the up and down functions on theese variables.

static DECLARE_MUTEX(mymutex);
void myfunc()
{
down(mymutex);
...
up(mymutex);
}

0 Comments:

Post a Comment

<< Home