Serialization of OSFlagSet()

Discussion to talk about software related topics only.
Post Reply
smorris
Posts: 1
Joined: Thu Feb 11, 2010 4:08 pm

Serialization of OSFlagSet()

Post 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
User avatar
lgitlitz
Posts: 331
Joined: Wed Apr 23, 2008 11:43 am
Location: San Diego, CA
Contact:

Re: Serialization of OSFlagSet()

Post 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.
Post Reply