This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: [SMP]serious bug in synchronisation primitives
- From: sandeep <shimple0 at yahoo dot com>
- To: Nick Garnett <nickg at ecoscentric dot com>
- Cc: ecos-discuss at sources dot redhat dot com
- Date: Mon, 13 Dec 2004 21:17:18 +0530
- Subject: Re: [ECOS] [SMP]serious bug in synchronisation primitives
- References: <417F9890.7080209@yahoo.com> <417FDBDB.4010106@yahoo.com> <419DDEBF.6090202@yahoo.com> <m3wtwhlxhq.fsf@xl5.calivar.com> <41A332ED.9000305@yahoo.com> <m3oehnijmu.fsf@xl5.calivar.com>
a dumb question in context of current thread.
since most of the code that calls lock on synchronisation primitive also calls
unlock. but in earlier discussion you mentioned to the effect that there are
cases where code is prepared to deal with returning from lock w/o actually
locking/owning the resource.
why not introduce an additional argument in lock call(s), default value(true) of
that indicates former condition and code passes (false) for latter kind of need.
in latter case code would be examining the return value of lock call and taking
the appropriate actions after examining the wake_reason if needed.
ntrwotr is place holder for argument name that signified 'need to return with
owning the resource' and it's default
within the lock code, for ex. in Cyg_Mutex::lock(cyg_bool ntrwotr) we can do
something like --
if (ntrwotr || result)
{
locked = true;
owner = self;
}
this trivial looking approach might not be solving the problem w/o causing other
problems else maintainers might have considered this as a fix to take care of
issue in this thread. i wonder what?
sandeep
__________________________________
Do you Yahoo!?
Meet the all-new My Yahoo! - Try it today!
http://my.yahoo.com
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss