summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/thread/thread.threads
Commit message (Collapse)AuthorAgeFilesLines
* Repair thread-unsafe modifications of n_alive in F.pass.cppBilly Robert O'Neal III2018-10-191-4/+10
| | | | | | | | In this example, the ctor of G runs in the main thread in the expression G(), and also in the copy ctor of G() in the DECAY_COPY inside std::thread. The main thread destroys the G() instance at the semicolon, and the started thread destroys the G() after it returns. Thus there is a race between the threads on the n_alive variable. The fix is to join with the background thread before attempting to destroy the G in the main thread. llvm-svn: 344820
* Mork more tests as FLAKYEric Fiselier2018-10-011-0/+1
| | | | llvm-svn: 343435
* [libcxx] [test] Fix Clang -Wunused-local-typedef warnings.Stephan T. Lavavej2017-07-191-1/+0
| | | | | | Fix D34536. llvm-svn: 308534
* Fix or move tests with non-standard assumptionsEric Fiselier2017-05-122-70/+22
| | | | llvm-svn: 302862
* Mark test using <sys/time.h> as UNSUPPORTED on WindowsEric Fiselier2017-05-051-0/+3
| | | | llvm-svn: 302298
* Add markup for libc++ dylib availabilityMehdi Amini2017-05-041-0/+10
| | | | | | | | | | | | | | | Libc++ is used as a system library on macOS and iOS (amongst others). In order for users to be able to compile a binary that is intended to be deployed to an older version of the platform, clang provides the availability attribute <https://clang.llvm.org/docs/AttributeReference.html#availability>_ that can be placed on declarations to describe the lifecycle of a symbol in the library. See docs/DesignDocs/AvailabilityMarkup.rst for more information. Differential Revision: https://reviews.llvm.org/D31739 llvm-svn: 302172
* Implement P0599: 'noexcept for hash functions'. Fix a couple of hash ↵Marshall Clow2017-03-231-0/+3
| | | | | | functions (optional<T> and unique_ptr<T>) which were mistakenly marked as 'noexcept'. Reviewed as https://reviews.llvm.org/D31234 llvm-svn: 298573
* Clean up more usages of _LIBCPP_HAS_NO_RVALUE_REFERENCESEric Fiselier2017-03-032-6/+2
| | | | llvm-svn: 296854
* Implement P0513R0 - "Poisoning the Hash"Eric Fiselier2017-01-212-1/+28
| | | | | | | | | | | | | | | | | | | | | Summary: Exactly what the title says. This patch also adds a `std::hash<nullptr_t>` specialization in C++17, but it was not added by this paper and I can't find the actual paper that adds it. See http://wg21.link/P0513R0 for more info. If there are no comments in the next couple of days I'll commit this Reviewers: mclow.lists, K-ballo, EricWF Reviewed By: EricWF Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D28938 llvm-svn: 292684
* [libcxx] [test] Fix comment typos, strip trailing whitespace.Stephan T. Lavavej2017-01-181-1/+1
| | | | | | No functional change, no code review. llvm-svn: 292434
* Fix unused parameters and variablesEric Fiselier2016-12-232-2/+2
| | | | llvm-svn: 290459
* Fix yet another dynamic exception specEric Fiselier2016-12-111-2/+2
| | | | llvm-svn: 289357
* [libcxx] Recover no-exceptions XFAILs - IAsiri Rathnayake2016-10-061-2/+5
| | | | | | | | | | | | | | | | First batch of changes to get some of these XFAILs working in the no-exceptions libc++ variant. Changed some XFAILs to UNSUPPORTED where the test is all about exception handling. In other cases, used the test macros TEST_THROW and TEST_HAS_NO_EXCEPTIONS to conditionally exclude those parts of the test that concerns exception handling behaviour. Reviewers: EricWF, mclow.lists Differential revision: https://reviews.llvm.org/D24562 llvm-svn: 283441
* Placate MSVC's unchecked malloc warning in thread tests.Eric Fiselier2016-06-221-1/+3
| | | | llvm-svn: 273385
* Move more _LIBCPP_VERSION tests to test/libcxx.Eric Fiselier2016-06-221-22/+0
| | | | llvm-svn: 273365
* Move native_handle thread tests to test/libcxxEric Fiselier2016-06-222-81/+0
| | | | llvm-svn: 273341
* Remove unused local var. Patch from STL@microsoft.comEric Fiselier2016-06-141-1/+1
| | | | llvm-svn: 272622
* Fix TEST_HAS_NO_EXCEPTIONS misspelling in the test suite.Eric Fiselier2016-06-021-1/+1
| | | | llvm-svn: 271501
* Mark LWG issue 2250 as completeEric Fiselier2016-06-022-0/+40
| | | | llvm-svn: 271475
* Remove trailing whitespace in test suite. Approved by Marshall Clow.Eric Fiselier2016-06-011-1/+1
| | | | llvm-svn: 271435
* [libcxx] Fix PR15638 - Only allocate in parent when starting a thread to ↵Eric Fiselier2016-04-201-15/+51
| | | | | | | | | | | | | | | | | | | | | prevent calling terminate. Summary: Hi, When creating a new thread libc++ performs at least 2 allocations. The first allocates a tuple of args and the functor that will be passed to the new thread. The second allocation is for the thread local storage needed internally by libc++. Currently the second allocation happens in the child thread, meaning that if it throws the program will terminate with an uncaught bad alloc. The solution to this is to allocate ALL memory in the parent thread and then pass it to the child. See https://llvm.org/bugs/show_bug.cgi?id=15638 Reviewers: mclow.lists, danalbert, jroelofs, EricWF Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D13748 llvm-svn: 266851
* Make it possible to build a no-exceptions variant of libcxx.Asiri Rathnayake2015-11-101-0/+1
| | | | | | | | | | | | Fixes a small omission in libcxx that prevents libcxx being built when -DLIBCXX_ENABLE_EXCEPTIONS=0 is specified. This patch adds XFAILS to all those tests that are currently failing on the new -fno-exceptions library variant. Follow-up patches will update the tests (progressively) to cope with the new library variant. Change-Id: I4b801bd8d8e4fe7193df9e55f39f1f393a8ba81a llvm-svn: 252598
* Remove test_atomic.h headerEric Fiselier2015-08-191-3/+2
| | | | | | | Because <atomic> can now be used in C++03 there is no need for the test_atomic.h header. This commit removes the header and converts all usages to use <atomic> instead. llvm-svn: 245468
* Use TestAtomic instead of std::atomic so the test can run in C++03Eric Fiselier2015-08-191-2/+3
| | | | llvm-svn: 245415
* [libcxx] Add Atomic test helper and fix TSAN failures.Eric Fiselier2015-08-182-6/+6
| | | | | | | | | | | | | | | | | | | Summary: This patch attempts to fix the last 3 TSAN failures on the libc++ bot (http://lab.llvm.org:8011/builders/libcxx-libcxxabi-x86_64-linux-ubuntu-tsan/builds/143). This patch also adds a `Atomic` test type that can be used where `<atomic>` cannot. `wait.exception.pass.cpp` and `wait_for.exception.pass.cpp` were failing because the test replaced `std::terminate` with `std::exit`. `std::exit` would asynchronously run the TLS and static destructors and this would cause a race condition. See PR22606 and D8802 for more details. This is fixed by using `_Exit` to prevent cleanup. `notify_all_at_thread_exit.pass.cpp` exercises the same race condition but for different reasons. I fixed this test by manually joining the thread before beginning program termination. Reviewers: EricWF, mclow.lists Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D11046 llvm-svn: 245389
* Remove sanitizer XFAILs on a test.Eric Fiselier2015-07-281-7/+0
| | | | llvm-svn: 243499
* Fix a handful of tests that fail in C++03Eric Fiselier2015-07-281-7/+3
| | | | llvm-svn: 243392
* Get thread sleep_for test passing in C++03Eric Fiselier2015-05-271-2/+5
| | | | llvm-svn: 238273
* Fix race condition in thread test.Eric Fiselier2015-05-191-8/+25
| | | | llvm-svn: 237745
* Fix race conditions in test class used throughout the std::thread tests.Eric Fiselier2015-04-0210-15/+34
| | | | | | | | | | | The test class 'G' reads and writes to the same static variables in its constructor, destructor and call operator. When threads are constructed using `std::thread t((G()))` there is a race condition between the destruction of the temporary and the execution of `G::operator()()`. The fix is to simply create the input before creating the thread. llvm-svn: 233946
* Use generic feature name for sanitizers that replace new and deleteEric Fiselier2015-03-101-1/+1
| | | | llvm-svn: 231841
* libc++ implements its' hash objects as deriving from std::unary_function, ↵Marshall Clow2015-01-071-0/+2
| | | | | | and the tests test for that. STL @ MS pointed out that the standard doesn't requie these objects to derive from unary_function, and so the tests should not require that either. Change the tests to check for the embedded typedefs - which ARE required. No change to the library. llvm-svn: 225403
* Move test into test/std subdirectory.Eric Fiselier2014-12-2030-0/+1397
llvm-svn: 224658
OpenPOWER on IntegriCloud