Thread (1 message) 1 message, 1 author, 2014-01-21

Re: [PATCH] strtod.3: ATTRIBUTES: Note functions that are thread safe with exceptions

From: Andre Majorel <hidden>
Date: 2014-01-21 13:52:44

On 2014-01-21 14:38 +0800, Peng Haitao wrote:
Maybe added simultaneously is better?

These functions can be safely used in multithreaded
applications, as long as setlocale(3) is not called to change
the locale.

->

These functions can be safely used in multithreaded
applications, as long as setlocale(3) is not simultaneously
called to change the locale.
I find the word "simultaneous" ambiguous when it comes to events
whose duration is non-zero.

Is the problem as simple as this ?
1) A thread is interrupted while it's running strto*().
2) The other thread calls setlocale().
3) strto*() resumes with locale data which is now inconsistent
   or invalid.

If that is the case, how about :

  These functions can be safely used in multithreaded
  applications, as long as the locale is not changed during
  their execution.

or

  These functions can be safely used in multithreaded
  applications, as long as setlocale() is not called during
  their execution.

(depending on whether calling setlocale() would invalidate the
data returned by a previous call to setlocale() with the same
argument).

-- 
André Majorel http://www.teaser.fr/~amajorel/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help