[ECOS] A safe way to print debug output in DSRs ?

Jonathan Larmour jlarmour@redhat.co.uk
Tue Aug 29 11:58:00 GMT 2000


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


More information about the Ecos-discuss mailing list