summaryrefslogtreecommitdiffstats
path: root/libcxx/src/mutex.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [libc++] Remove _LIBCPP_BUILDING_XXX macros, which are redundant since ↵Louis Dionne2018-08-011-1/+0
| | | | | | | | | | | | | | _LIBCPP_BUILDING_LIBRARY Summary: As suggested by Marshall in https://reviews.llvm.org/D49914 Reviewers: mclow.lists, EricWF Subscribers: christof, dexonsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D50008 llvm-svn: 338475
* [Libc++] Use #pragma push_macro/pop_macro to better handle min/max on WindowsEric Fiselier2017-05-311-0/+1
| | | | | | | | | | | | | | | | Summary: This patch improves how libc++ handles min/max macros within the headers. Previously libc++ would undef them and emit a warning. This patch changes libc++ to use `#pragma push_macro` to save the macro before undefining it, and `#pragma pop_macro` to restore the macros and the end of the header. Reviewers: mclow.lists, bcraig, compnerd, EricWF Reviewed By: EricWF Subscribers: cfe-commits, krytarowski Differential Revision: https://reviews.llvm.org/D33080 llvm-svn: 304357
* Recommit [libcxx] Never use <cassert> within libc++Eric Fiselier2017-02-041-4/+3
| | | | | | | | | | It is my opinion that libc++ should never use `<cassert>`, including in the `dylib`. This patch remove all uses of `assert` from within libc++ and replaces most of them with `_LIBCPP_ASSERT` instead. Additionally this patch turn `LIBCXX_ENABLE_ASSERTIONS` off by default, because the standard library should not be aborting user programs unless explicitly asked to. llvm-svn: 294107
* Revert "[libcxx] Never use <cassert> within libc++"Eric Fiselier2017-01-241-3/+4
| | | | | | | | This reverts commit r292883. Unfortunately <string_view> uses _LIBCPP_ASSERT in a way which is not compatible with the C++11 dylib build. I'll investigate more tomorrow. llvm-svn: 292923
* [libcxx] Never use <cassert> within libc++Eric Fiselier2017-01-241-4/+3
| | | | | | | | | | | | | | | | | Summary: It is my opinion that libc++ should never use `<cassert>`, including in the `dylib`. This patch remove all uses of `assert` from within libc++ and replaces most of them with `_LIBCPP_ASSERT` instead. Additionally this patch turn `LIBCXX_ENABLE_ASSERTIONS` off by default, because the standard library should not be aborting user programs unless explicitly asked to. Reviewers: mclow.lists, compnerd, smeenai Reviewed By: mclow.lists Subscribers: mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D29063 llvm-svn: 292883
* Fix Windows try_lock implementationEric Fiselier2017-01-141-2/+2
| | | | llvm-svn: 292011
* thread_support: split out {,non-}recursive mutexSaleem Abdulrasool2017-01-051-4/+4
| | | | | | | | Split out the recursive and non-recursive mutex. This split is needed for platforms which may use differing types for the two mutex (e.g. Win32 threads). llvm-svn: 291145
* Mark libc++ internal globals with _LIBCPP_SAFE_STATIC.Eric Fiselier2016-09-281-2/+2
| | | | | | | | | | | | | This patch applies the _LIBCPP_SAFE_STATIC attribute to internal globals, most of which are locking primitives, in order to ensure that they can safely be used during program startup. This patch also fixes an unsafe static init issue with the global locks used to implement atomic operations on shared pointers. Previously the locks were initialized using a dynamically initialized pointer, so it was possible that the pointer was uninitialized. llvm-svn: 282640
* [libcxx] Fix a data race in call_onceKuba Brecka2016-09-041-4/+1
| | | | | | | | call_once is using relaxed atomic load to perform double-checked locking, which contains a data race. The fast-path load has to be an acquire atomic load. Differential Revision: https://reviews.llvm.org/D24028 llvm-svn: 280621
* Refactor pthread usage of libcxx.Asiri Rathnayake2016-05-061-48/+26
| | | | | | | | | | | | | This patch extracts out all the pthread dependencies of libcxx into the new header __threading_support. The motivation is to make it easy to re-target libcxx into platforms that do not support pthread. Original patch from Fulvio Esposito (fulvio.esposito@outlook.com) - D11781 Applied with tweaks - D19412 Change-Id: I301111f0075de93dd8129416e06babc195aa936b llvm-svn: 268734
* Move atomic_support.h and config_elast.h into src/includeEric Fiselier2015-08-181-1/+1
| | | | llvm-svn: 245354
* [libcxx] Add atomic_support.h header to src that handles needed atomic ↵Eric Fiselier2015-07-071-3/+7
| | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 241532
* Allow libc++ to be built on systems without POSIX threadsJonathan Roelofs2014-09-051-0/+27
| | | | | | | | | | 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 llvm-svn: 217271
* Peter Collingbourne: Fix warnings when compiling with -DNDEBUG.Howard Hinnant2013-09-211-0/+3
| | | | llvm-svn: 191148
* noexcept and constexpr applied to <mutex>.Howard Hinnant2012-07-211-8/+9
| | | | llvm-svn: 160604
* Quash a whole bunch of warningsHoward Hinnant2011-12-011-2/+1
| | | | llvm-svn: 145624
* license changeHoward Hinnant2010-11-161-2/+2
| | | | llvm-svn: 119395
* Fixing whitespace problemsHoward Hinnant2010-08-221-2/+2
| | | | llvm-svn: 111751
* now works with -fno-exceptions and -fno-rttiHoward Hinnant2010-08-111-0/+4
| | | | llvm-svn: 110828
* [util.smartptr.hash]Howard Hinnant2010-06-031-1/+1
| | | | llvm-svn: 105393
* patch by Jeffrey Yasskin for porting to Ubuntu Hardy. Everything was ↵Howard Hinnant2010-05-241-2/+2
| | | | | | accepted except there were some bug fixes needed in <locale> for the __nolocale_* series. For the apple branch I ended up using templates instead of the var_args solution because it seemed both safer and more efficient. llvm-svn: 104516
* Wiped out some non-ascii characters that snuck into the copyright.Howard Hinnant2010-05-111-1/+1
| | | | llvm-svn: 103516
* libcxx initial importHoward Hinnant2010-05-111-0/+246
llvm-svn: 103490
OpenPOWER on IntegriCloud