[PATCH] D34918: [libc++] Avoid atomic built-ins for NO_THREADS build

Weiming Zhao via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 3 10:17:36 PDT 2017


weimingz added a comment.

In https://reviews.llvm.org/D34918#797661, @joerg wrote:

> Lock-free atomic operations are also signal safe. Your code is not. While I don't know whether all this functions are not required to be signal safe, the general assertion is certainly questionable.


No, they are no signal safe.  Per [1], "call to any library function, except the following signal-safe functions (note, in particular, dynamic allocation is not signal-safe):".

Locale.cpp should be fine with the change.
{set,get}_new_handler, {set,get}_unexpected_handler are not in the list.
I'm not very sure about "__libcpp_refstring". Seems it is only used by stdexcept. Although throw expression is explicitly stated as not signal safe, the ref counting of stdexcept might be. We can leave it unchanged.

[1] http://en.cppreference.com/w/cpp/utility/program/signal


Repository:
  rL LLVM

https://reviews.llvm.org/D34918





More information about the llvm-commits mailing list