This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: A safe way to print debug output in DSRs ?
- To: Fabrice Gautier <Fabrice_Gautier at sdesigns dot com>
- Subject: Re: [ECOS] A safe way to print debug output in DSRs ?
- From: Jonathan Larmour <jlarmour at redhat dot co dot uk>
- Date: Tue, 29 Aug 2000 19:58:52 +0100
- CC: "Ecos-List \(E-mail\)" <ecos-discuss at sourceware dot cygnus dot com>
- Organization: Red Hat UK Ltd.
- References: <8AE4B526B977D411841F00A0CC334020052C30@cuz-exchange.sdesigns.net>
Fabrice Gautier wrote:
>
> I'm looking for a safeway to print debug ouput while in a DSR.
>
> Printf is not safe for it locks a mutex.
>
> The weird thing is that AFAICS it uses this mutex only when using the
> thread-safe printf option. Could this mean that the not thread safe printf
> call is more safe for DSRs?
Yes, but any threads that used printf wouldn't be using it in a thread-safe
way. If this isn't going to happen, then go ahead and disable the option.
> Or is there another call that is safe? What about diag_printf?
diag_printf is probably a better option since it's only simple debug output
you want. Just include <cyg/infra/diag.h> and go from there.
Jifl
--
Red Hat, 35 Cambridge Place, Cambridge, UK. CB2 1NS Tel: +44 (1223) 728762
"Plan to be spontaneous tomorrow." || These opinions are all my own fault