Remember that Mutex must first be received / received , then released / set. In addition, the task that gets the mutex belongs . This prevents the release of another task from the mutex to which it does not belong.
, , ISR ( - ), , .
ISR , , - . take/give.
. VxWorks ISR !
:
Task A ISR
semTake(mutex)
....
semGive(mutex)
A . ISR , . ISR. A , ISR ? , , ISR , A .
, "" ISR, :
Task A Task B ISR
semTake(mutex)
...
<context switch happens>
<B runs>
semGive(mutex)
A - , , B. ISR B. ISR?
, , Get/Set. , semGive.
, semGive ISR?