This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Mutex & Asserts during initialisation


> From: Andrew Lunn
>
> Humm, i think this is reasonable behaviour. Anything that tries to use
> a mutex must assume it can block. Otherwise why are you using a mutex!

I can see the other side of this. You want to write a driver that can work
in a multi-threaded environment, so you include a mutex in it. But then you
want to call it from startup code. Rather than write a second specialized
non-multi-threaded driver, or include some sort of flag that tells it to
skip the locking and unlocking, it's much cleaner to simply consider the
attempt to lock a mutex before the threading system has been initialized a
harmless null operation.

--

Ciao,               Paul D. DeRocco
Paul                mailto:pderocco@ix.netcom.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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]