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]

Re: A safe way to print debug output in DSRs ?


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

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