Chris O'Byrne - YAVRTOS |
||||||||||||||||||||||||||||||||||
|
Mutexes
Detailed DescriptionA MUTual EXclusion object - only one task can "own" a mutex at any one time.Mutexes are "owned" by calling lock_on(), and released by calling lock_off() If another task tries to own an "owned" mutex, that task will be suspended until the mutex becomes available. Tasks may own as many mutexes as they wish, and mutexes will automatically be released when the task exits See using mutexes for information on how to use mutexes If malloc() is going to be used by your task, then you may require a mutex for the microcontroller memory - see How do I use malloc() and free() safely? Function Documentation
Unlock a mutex. This function can only usefully be called by the task that locked the mutex in the first place, and it may end up yielding control to a task that is waiting on the mutex. The return value is zero for success.
Note that if someone has called stop_task() on this task with the
Lock on a mutex. The return value is zero for success. Since the task may be suspended while waiting for another task to release the mutex, this function may only be called by tasks with a non-zero priority.
|
|||||||||||||||||||||||||||||||||
YAVRTOS and YAVRTOS documentation Copyright © 2007-2008 Chris O'Byrne. Email - chris <at> obyrne <dot> com