summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/thread/thread.threads
Commit message (Collapse)AuthorAgeFilesLines
* [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