Page 1 of 1

Serialization of OSFlagSet()

Posted: Thu Feb 11, 2010 4:18 pm
by smorris
I'm using Rel24_rc2

Does ucos serialize Flag operations?

E.g., if I have two tasks setting flags in the same OS_FLAGS struct, can I be assured that the OSFlagSet()'s will be serialized?

What if I one writer is actually an ISR, and the other writer is a task?

Thanks

Re: Serialization of OSFlagSet()

Posted: Thu Feb 11, 2010 5:36 pm
by lgitlitz
Writing the the OS Flag stuct is a protected operation. If you look at the functions for writing to these flags the very first thing that happens is a UCOS_ENTER_CRITICAL(). This will set the interrupt mask to level 7. This will block all task switching and interruptsexcept for level 7 interrupts. Level 7 interrupts are not allowed to use any OS functions for this reason.