Page 1 of 1

OSFlagPendAll question

Posted: Tue Feb 09, 2016 7:05 am
by vsabino
Hi,
I have a question regarding this function, perhaps for all OSFlagPend variants.

If a task is waiting (blocked) forever (timeout = 0) on a particular bitmask, what would happen if I change the mask while it's waiting. Will OSFlagPendall() continue to wait for the original mask, or will the OS know that the mask was changed?

Thanks,
Victor

Re: OSFlagPendAll question

Posted: Tue Feb 09, 2016 7:17 am
by pbreed
Wont know the mask has changed...

Re: OSFlagPendAll question

Posted: Tue Feb 09, 2016 7:20 am
by vsabino
Ok. I thought that would be the case...

So, how would be a proper way to change the mask? introduce a timeout?

Re: OSFlagPendAll question

Posted: Tue Feb 09, 2016 5:28 pm
by pbreed
I'd use onf of the 32 possible flags as the change the mask flag....
Always have that one valid in the mask...
Then when you want to change the mask it wakes up changes the mask goes back to sleep...