Download ACR89U-A1 Application Programming Interface V1.01

Transcript
xSemaphoreTakeRecursive( xMutex, ( portTickType ) 10 );
xSemaphoreTakeRecursive( xMutex, ( portTickType ) 10 );
// The mutex has now been 'taken' three times, so will not
be
// available to another task until it has also been given
back
// three times.
have
// these calls sequentially, it would be more likely that
calls
// to xSemaphoreGiveRecursive() would be called as a call
the
stack
// unwound. This is just
xSemaphoreGiveRecursive(
xSemaphoreGiveRecursive(
xSemaphoreGiveRecursive(
}
else
{
access
}
}
Again it is unlikely that real code would
}
for demonstrative purposes.
xMutex );
xMutex );
xMutex );
// Now the mutex can be taken by other tasks.
// We could not obtain the mutex and can therefore not
// the shared resource safely.
Page 69 of 78
ACR89U-A1 – Application Programming Interface
Version 1.01
info@acs.com.hk
www.acs.com.hk