This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: binary vs. counting semaphore and timed wait
- From: Nick Garnett <nickg at ecoscentric dot com>
- To: David Brennan <eCos at brennanhome dot cxm>
- Cc: eCos Discuss <ecos-discuss at sources dot redhat dot com>
- Date: 05 Jun 2003 10:51:58 +0100
- Subject: Re: [ECOS] binary vs. counting semaphore and timed wait
- References: <1054617967.1996.11.camel@clifford.brennanhome.cxm>
David Brennan <eCos@brennanhome.cxm> writes:
> In the process of porting an application to eCos, I came across the use
> of a binary semaphore with a timed wait function. The eCos
> Cyg_Binary_Semaphore interface does not provide this. But it sure looks
> like the rest of the code is similar enough to the counting semaphore
> that it could be implemented very easily. However before I do this, is
> there some particular reason this was not implemented? I'd be very
> interested to hear if this is a bad idea.
>
Timeouts were added to the counting semaphores because it was needed
for POSIX compatibility. Nobody needed it in the binary semaphores
until now.
If you want to add a timed wait for binary semaphores, go ahead. Make
sure you ifdef it with CYGFUN_KERNEL_THREADS_TIMER, and follow the
example of the counting semaphores. In theory it should be a fairly
simple copy-paste-edit of the counting semaphores code.
When you have it done, submit a patch on the patches list, with a
ChangeLog entry, and someone will check it over and commit it to the
repository.
--
Nick Garnett eCos Kernel Architect
http://www.ecoscentric.com/ The eCos and RedBoot experts
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss