This is the mail archive of the
mailing list for the newlib project.
- From: Marcus Hult <marcushult at gmail dot com>
- To: newlib at sourceware dot org
- Date: Tue, 8 Jan 2013 12:36:34 +0100
- Subject: libm reentrancy
I am a bit confused about reentrancy in the newlib libm. I have read
the explanation about the _REENT_ONLY flag here:
Most functions in libm does not have an _r version, but when defining
the symbol _REENT_ONLY, a lot of those functions are ifndef'ed out.
Why are there no reentrant versions of these functions? And how is the
_REENT_ONLY flag supposed to be used with libm?
To make these functions in libm thread safe, i guess i need a _reent
struct in each thread and set the _impure_ptr to this when switching
tasks? Or how can i assure the libm function calls are thread safe?
Thanks in advance