This is the mail archive of the
ecos-discuss@sourceware.cygnus.com
mailing list for the eCos project.
Re: cyg_io_write
- To: Gary Thomas <gthomas at redhat dot com>
- Subject: Re: [ECOS] cyg_io_write
- From: Bob Koninckx <bob dot koninckx at mech dot kuleuven dot ac dot be>
- Date: Wed, 28 Jun 2000 19:19:13 +0200
- CC: Dave Airlie <airlied at parthus dot com>, ecos-discuss at sourceware dot cygnus dot com
- Organization: KULeuven
- References: <XFMail.000628091032.gthomas@redhat.com>
- Reply-To: bob dot koninckx at mech dot kuleuven dot ac dot be
Gary Thomas wrote:
>
> On 28-Jun-00 Dave Airlie wrote:
> >
> > Can I call cyg_io_write from with a cyg_io_write? as in my app calls a
> > virtual cyg_io_write which then calls a cyg_io_write on a real serial
> > port... does this sound like something I really shouldn't be doing, it
> > doesn't seem to work, but the problems I've been having I would be loathe
> > to blame eCos before asking :-)
> >
>
> I don't see any reason why it wouldn't work. This function should be
> reentrant as well as serially reusable.
Make sure you never lock an already locked mutex. I remember spending
quite some time searching for a deadlock caused by this .... (I am not
sure it will happen in your case though)
Might be an idea do modify the cyg_mutex_t behaviour in such a way that
a call to cyg_mutexc_lock doesnt do anything if it is called from the
thread that already owns the lock. Similar to what "How are they called
again ??" does with their CRITICAL_SECTION objects. Cygnus folks ??
Regards,
Bob
--
-----------------------------------------------------------------------
ir. Bob Koninckx
Katholieke Universiteit Leuven
Division Production Engineering, tel. +32 16 322535
Machine Design and Automation fax. +32 16 322987
Celestijnenlaan 300B bob.koninckx@mech.kuleuven.ac.be
B-3001 Leuven Belgium
http://www.mech.kuleuven.ac.be/pma.html
-----------------------------------------------------------------------