[ECOS] cyg_semaphore_post

Andrew Lunn andrew.lunn@ascom.ch
Mon Feb 11 04:10:00 GMT 2002

On Mon, Feb 11, 2002 at 12:58:04PM +0100, Stijn Symons wrote:
> Will the cyg_semaphore_post function still increment the count if there
> are threads waiting on it, or does it only wake up a thread?
> And witch thread does it wake up, the one with the highest priority or
> just random?

The documentation says:

"If there are threads waiting on this semaphore this will make exactly
one of then. Otherwise it simply increments the semaphore count".

So that answers 1/2 of your question. 

Reading the code, it looks like post takes from the head of the
queue. It does not look like the queue is prioritized.

Thinking about it, i'm not sure priorities make sense. Could you
explain what you mean and how you would use them.


Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss

More information about the Ecos-discuss mailing list