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: print and mutex


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


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