AnsweredAssumed Answered

Calling C_ISR_PostSemaphore from a thread

Question asked by tcmichals on Mar 8, 2011
Latest reply on Mar 9, 2011 by SFernandez

I have a function that does a post on a semaphore and at times this same function might be called by a thread, to make this code easier I was just calling the C_ISR_PostSemaphore, so it is ISR safe.  Does this cause any issues calling C_ISR_PostSemaphore via a thread instead of PostSemaphore?

 

Also, one caveat is only one type of calling function is enabled at anyone time... ie a thread calls the function no ISR is configured... the user does something... then disables the thread and enables the ISR... etc...

 

For example

 

commonFoo()

{

...

VDK::C_ISR_PostSemaphore(semaphore)

}

 

 

void ISR()

{

commonFoo();

}

 

 

workerThread()

{

 

.... code

commonFoo()

}

Outcomes