summaryrefslogtreecommitdiffstats
path: root/libcxx/src/thread.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [libcxx] Whitelist inclusion of sysctl.h instead of blacklistingBen Craig2016-01-291-3/+8
| | | | | | | | | | | Instead of excluding all known operating systems that are not derived from BSD, I now include all operating systems that claim to be derived from BSD. Hopefully, that will make it so that this check doesn't need to change for every new operating system that comes along. http://reviews.llvm.org/D16634 llvm-svn: 259193
* Don't include <sys/sysctl.h> on CloudABI.Ed Schouten2015-03-101-2/+2
| | | | | | | As CloudABI does not provide sysctl(), this header is not present. Make thread.cpp build correctly (and pass all tests) by not including the header. llvm-svn: 231768
* libc++: support NaCl when building thread.cppJF Bastien2014-12-021-4/+4
| | | | | | | | | | | | | | Summary: NaCl shouldn't include sysctl.h when trying to determine std::thread::hardware_concurrency, it should instead use sysconf(_SC_NPROCESSORS_ONLN) through unistd.h. No test needs to be changed, since hardware_concurrency.pass.cpp already tests that std::thread::hardware_concurrency > 0. Test Plan: make check-libcxx Reviewers: dschuff, danalbert Subscribers: jfb, cfe-commits Differential Revision: http://reviews.llvm.org/D6470 llvm-svn: 223128
* Allow libc++ to be built on systems without POSIX threadsJonathan Roelofs2014-09-051-0/+5
| | | | | | | | | | 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
* Handle partial nanosleeps in this_thread::sleep_forDavid Majnemer2014-06-041-1/+3
| | | | | | | | | | Signals may result in nanosleep returning with only some of the requested sleeping performed. Utilize nanosleep's "time-remaining" out parameter to continue sleeping when this occurs. llvm-svn: 210210
* Switch to using C++ style casts.Joerg Sonnenberger2014-01-041-1/+1
| | | | llvm-svn: 198505
* G M: Provides the _LIBCPP_WARNING macro, to be used for MSVC only, since ↵Howard Hinnant2013-10-041-1/+5
| | | | | | that compiler doesn't support #warning. llvm-svn: 191980
* Xing Xue: port to IBM XLC++/AIX.Howard Hinnant2013-08-141-2/+2
| | | | llvm-svn: 188396
* Windows support in thread::hardware_concurrency.Howard Hinnant2013-07-021-0/+7
| | | | llvm-svn: 185451
* Matthew Dempsky: POSIX defines that the _POSIX_C_SOURCE macros are to be set ↵Howard Hinnant2013-06-301-3/+3
| | | | | | | | | | | | | | | | | | | | by user code to specify what version of POSIX the system should provide. If you want to check what version of POSIX is actually available, you're supposed to test _POSIX_VERSION. However, since sysconf() has been in POSIX since 1995, it's probably safe to assume it's available on any system with a C++11 compiler, especially if _SC_NPROCESSORS_ONLN is defined too. So no point in a complicated preprocessor rule if just we unconditionally include <unistd.h> (on non-Windows systems). Also, I've added a #warning for to help porters detect when a suitable implementation isn't detected at compile-time. Howard: Matthew, can you patch CREDITS.TXT? Thanks. llvm-svn: 185275
* Create a weak pthread_create reference on NetBSD to not force aJoerg Sonnenberger2013-05-171-0/+4
| | | | | | dependency on libpthread for code that doesn't use threads itself. llvm-svn: 182161
* Bruce Mitchener, Jr.: Port to emscripten. Fixes ↵Howard Hinnant2013-03-291-1/+1
| | | | | | http://llvm.org/bugs/show_bug.cgi?id=15624. llvm-svn: 178354
* Fix a few warnings/errors for compiling with -fno-exceptions.Howard Hinnant2013-03-281-0/+2
| | | | llvm-svn: 178267
* Removed raw references to __sun__, __FreeBSD__, __GLIBC__ and __linux__; now ↵Marshall Clow2013-03-181-1/+1
| | | | | | just check to see if they are defined. llvm-svn: 177310
* Removed raw references to _WIN32; now just check to see if it is defined.Marshall Clow2013-03-181-1/+1
| | | | llvm-svn: 177291
* Belt and suspenders when calling sysconfMarshall Clow2013-02-071-1/+3
| | | | llvm-svn: 174642
* Another libc++ warning suppression on Linux; no functionality changeMarshall Clow2013-02-071-1/+1
| | | | llvm-svn: 174637
* Saleem Abdulrasool: cleanup a few more compile warnings emitted by GCC.Howard Hinnant2012-12-271-2/+4
| | | | llvm-svn: 171173
* Change sleep_for, sleep_until, and the condition_variable timed waitHoward Hinnant2012-08-301-3/+15
| | | | | | | | | | | | | functions to protect against duration and time_point overflow. Since we're about to wait anyway, we can afford to spend a few more cycles on this checking. I purposefully did not treat the timed try_locks with overflow checking. This fixes http://llvm.org/bugs/show_bug.cgi?id=13721 . I'm unsure if the standard needs clarification in this area, or if this is simply QOI. The <chrono> facilities were never intended to overflow check, but just to not overflow if durations stayed within +/- 292 years. llvm-svn: 162925
* Andrew Morrow: The attached patch is an attempt to implementHoward Hinnant2012-08-021-2/+11
| | | | | | | std::thread::hardware_concurrency for platforms that don't offer sysctl, but do provide a POSIX sysconf and _SC_NPROCESSORS_ONLN. llvm-svn: 161190
* noexcept applied to <thread>.Howard Hinnant2012-07-211-1/+1
| | | | llvm-svn: 160606
* Solaris port. Currently sees around 200 test failures, mostly related toDavid Chisnall2012-02-291-1/+1
| | | | | | | | | | Solaris not providing some of the locales that the test suite uses. Note: This depends on an xlocale (partial) implementation for Solaris and a couple of fixed standard headers. These will be committed to a branch later today. llvm-svn: 151720
* Quash a whole bunch of warningsHoward Hinnant2011-12-011-1/+1
| | | | llvm-svn: 145624
* Work on Windows port by Ruben Van BoxemHoward Hinnant2011-09-231-0/+2
| | | | llvm-svn: 140384
* Effort to reduce the number of exported symbolsHoward Hinnant2010-12-171-3/+18
| | | | llvm-svn: 122057
* license changeHoward Hinnant2010-11-161-2/+2
| | | | llvm-svn: 119395
* Convert __thread_local_data to the singleton patternHoward Hinnant2010-10-141-1/+6
| | | | llvm-svn: 116500
* [futures.atomic_future] and notify_all_at_thread_exit. This completes the ↵Howard Hinnant2010-09-031-0/+22
| | | | | | header <future> and all of Chapter 30 (for C++0x enabled compilers). llvm-svn: 113017
* future continues ...Howard Hinnant2010-08-271-0/+55
| | | | llvm-svn: 112284
* Fixing whitespace problemsHoward Hinnant2010-08-221-4/+4
| | | | llvm-svn: 111751
* now works with -fno-exceptions and -fno-rttiHoward Hinnant2010-08-111-0/+4
| | | | llvm-svn: 110828
* For compiling on FreeBSDHoward Hinnant2010-05-251-0/+1
| | | | llvm-svn: 104616
* patch by Jeffrey Yasskin for porting to Ubuntu Hardy. Everything was ↵Howard Hinnant2010-05-241-2/+8
| | | | | | 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/+73
llvm-svn: 103490
OpenPOWER on IntegriCloud