Jonathan Roelofs
044df63102
Do not include pthread.h and sched.h when threads are disabled
...
Patch by Philippe Daouadi!
http://reviews.llvm.org/D9639
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@246168 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-27 17:47:34 +00:00
Eric Fiselier
c6e466911f
[libcxx] Add atomic_support.h header to src that handles needed atomic operations.
...
Summary:
In some places in libc++ we need to use the `__atomic_*` builtins. This patch adds a header that provides access to those builtins in a uniform way from within the dylib source.
If the compiler building the dylib does not support these builtins then a warning is issued.
Only relaxed loads are needed within the headers. A singe function to do these relaxed loads has been added to `<memory>`.
This patch applies the new atomic builtins to `__shared_count` and `call_once`.
Reviewers: mclow.lists
Subscribers: majnemer, jroelofs, cfe-commits
Differential Revision: http://reviews.llvm.org/D10406
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@241532 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-07 00:27:16 +00:00
Eric Fiselier
bc1e44d14e
LWG2442: call_once() shouldn't DECAY_COPY(). Patch from K-Ballo.
...
This patch fixes LWG issue 2422 by removing the DECAY_COPY from call once.
The review can be found here: http://reviews.llvm.org/D10191
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@239654 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-13 02:23:00 +00:00
Sergey Dmitrouk
fff544efbd
Explicitly include <sched.h> for sched_yield()
...
It might be implicitly included by <pthread.h> (and that's why it worked
so far), but it's not guaranteed (for example, this is not the case with
newlib).
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@223661 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-08 14:50:21 +00:00
Jonathan Roelofs
8d86b2e686
Allow libc++ to be built on systems without POSIX threads
...
If you're crazy enough to want this sort of thing, then add
-D_LIBCPP_HAS_NO_THREADS to your CXXFLAGS and
--param=additiona_features=libcpp-has-no-threads to your lit commnad line.
http://reviews.llvm.org/D3969
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@217271 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-05 19:45:05 +00:00
Marshall Clow
05d116eb87
std::once_flag was forward declared with _LIBCPP_TYPE_VIS decoration, and the defined with _LIBCPP_TYPE_VIS_ONLY decoration. Make them match
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@214219 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-29 21:05:31 +00:00
Howard Hinnant
0f678bd69e
Nico Rieck: this patch series fixes visibility issues on Windows as explained in < http://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-August/031214.html >.
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@188192 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-12 18:38:34 +00:00
Howard Hinnant
83eade6abb
No functionality change at this time. I've split _LIBCPP_VISIBLE up into two flags: _LIBCPP_TYPE_VIS and _LIBCPP_FUNC_VIS. This is in preparation for taking advantage of clang's new __type_visibility__ attribute.
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@176593 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-06 23:30:19 +00:00
Howard Hinnant
33be35effe
Dimitry Andric: many visibility fixes. Howard: Much appreciated. Can you send me a patch to CREDITS.TXT?
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@163862 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-14 00:39:16 +00:00
Howard Hinnant
499c61f999
noexcept and constexpr applied to <mutex>.
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@160604 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-21 16:13:09 +00:00
Howard Hinnant
ec3773c2da
Quash a whole bunch of warnings
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@145624 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-01 20:21:04 +00:00
Howard Hinnant
9996844df0
Further macro protection by replacing _[A-Z] with _[A-Z]p
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@145410 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-29 18:15:50 +00:00
Howard Hinnant
66c6f9733b
Add protection from min/max macros
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@145407 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-29 16:45:27 +00:00
Howard Hinnant
08e17472e4
Windows support by Ruben Van Boxem.
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@142235 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-17 20:05:10 +00:00
Howard Hinnant
0949eedbd6
_STD -> _VSTD to avoid macro clash on windows
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@134190 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-30 21:18:19 +00:00
Howard Hinnant
57cff290a4
I had a giant misunderstanding of what 'synchronizes with' meant in [futures.async]/p5. This invalidated the current design of async in <future>. This is a new design, based on my new understanding, which has been confirmed on the lwg mailing list. The summary is that ~future() (and ~shared_future()) will block when they are created from within async, and the thread hasn't finished yet. As part of this work I created two new type traits: __invokable<F, Args...>::value and __invoke_of<F, Args...>::type. These are what result_of<F(Args...)> wanted to be when it grew up, but never will be. __invoke_of is carefully crafted so that it can serve as its own enable_if (type doesn't exist if the signature isn't invokable). All of this work is C++11 only.
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@131639 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-19 15:05:04 +00:00
Howard Hinnant
ad935d583d
Brought call_once variadic call up to current spec, which allows move-only functors and move-only arguments, but disallows functors with non-const lvalue reference parameters.
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@131414 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-16 19:05:11 +00:00
Howard Hinnant
6fd4b669ca
Fixing an ambiguity in variadics found by clang.
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@123337 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-12 22:56:59 +00:00
Howard Hinnant
f8f852138f
N3191: C++ Timeout Specification
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@119909 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-20 19:16:30 +00:00
Howard Hinnant
b64f8b07c1
license change
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@119395 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-16 22:09:02 +00:00
Howard Hinnant
b9af2eae4a
visibility-decoration.
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@114559 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-22 18:02:38 +00:00
Howard Hinnant
73d21a4f07
Changed __config to react to all of clang's currently documented has_feature flags, and renamed _LIBCPP_MOVE to _LIBCPP_HAS_NO_RVALUE_REFERENCES to be more consistent with the rest of the libc++'s flags, and with clang's nomenclature.
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@113086 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-04 23:28:19 +00:00
Howard Hinnant
324bb03bb9
Fixing whitespace problems
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@111750 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-22 00:02:43 +00:00
Howard Hinnant
f5256e16df
Wiped out some non-ascii characters that snuck into the copyright.
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@103516 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-11 21:36:01 +00:00
Howard Hinnant
bc8d3f97eb
libcxx initial import
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@103490 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-11 19:42:16 +00:00