This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: print and mutex
- From: Andrew Lunn <andrew at lunn dot ch>
- To: steve smith <mister dot steve dot smith at gmail dot com>
- Cc: ecos-discuss at sources dot redhat dot com
- Date: Tue, 18 Jan 2005 18:56:10 +0100
- Subject: Re: [ECOS] print and mutex
- References: <30968995050118094825f48d1f@mail.gmail.com>
On Tue, Jan 18, 2005 at 09:48:14AM -0800, steve smith wrote:
> Hey All,
> Suppose printf is writing several bytes to the internal USART on a
> micro and an external interrupt of highest priority occurs; does
> printf yield to that interrupt or does ISR get delayed until printf
> completes?
Depends on the underlying device driver. If you are using haldiag
which is passing everything to RedBoot then the interrupt will be
disabled until the output is complete. If you are using a proper
serial driver which is interrupt driven then the interrupt will not be
disabled.
>
> Also in the example code twothreads.c
> there is comment saying /* note: printf() must be protected by a call
> to cyg_mutex_lock() */
Im not sure this is true anymore. Try googling for this. I think i
remeber Jifl saying this was not needed now. But i could be wrong.
Andrew
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss