This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
cyg_flag_timed_wait()/cyg_flag_setbits() behaviour question
- From: David Roethig <droethig at cipher dot com>
- To: ecos-discuss at ecos dot sourceware dot org
- Date: Thu, 14 Sep 2006 10:50:39 -0700
- Subject: [ECOS] cyg_flag_timed_wait()/cyg_flag_setbits() behaviour question
- Reply-to: droethig at cipher dot com
We're using flags to wakeup threads. We use different bit
contained within one flag for signaling. (i.e. CAN_RX is bit 1,
SHUTDOWN is bit2, etc.)
I have some questions/comments regarding the use
of this kernel feature:
1) the flag_result returned with cyg_flag_timed_wait()
contains all of the current bits set not the mask
supplied with the cyg_flag_timed_wait() call.
It seems to me that the result should only return the
bits this call is interested in seeing. Is this
expected behaviour?
2) the cyg_flag_setbits() routine in flags.cxx clears
the current value of the flag upon finding the first
thread waiting on the bit(s). It should wait until
all tasks are woken before clearing the flag bits.
It too suffers from the problem that the entire flag
is cleared, not just the bit(s) desired.
This means that multiple threads cannot use the
same cyg_flag_t to wait for different (or common) bits.
An I misunderstanding the use of the flag feature?
Thanks,
Dave
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss