[ECOS] is diag_printf thread safe?
Andrew Lunn
andrew@lunn.ch
Mon Jun 12 06:50:00 GMT 2006
On Mon, Jun 12, 2006 at 11:51:04AM +0530, saurabh prakash wrote:
> hello,
>
> i want to know
>
> 1) whether diag_printf() and printf()
> are thread safe?
They won't crash/cause corruption if two or more threads call them
simultaneously. You might get interleaved output. You would need to
check where the isr disable/mutex lockigng is respectively.
> 2) is it safe to call them from a DSR
printf no. diag_printf() can be called from ISR, DSR, threads etc.
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
More information about the Ecos-discuss
mailing list