summaryrefslogtreecommitdiffstats
path: root/libcxx/src/thread.cpp
diff options
context:
space:
mode:
authorMarshall Clow <mclow.lists@gmail.com>2016-08-25 15:09:01 +0000
committerMarshall Clow <mclow.lists@gmail.com>2016-08-25 15:09:01 +0000
commitd437fa5c8c1185af695b87cdd5ea83aa4a6e7382 (patch)
tree2fc9b60f206ef14e242a52af06f8f95b95693962 /libcxx/src/thread.cpp
parentb41b990e05797d1d69ea735bb168893974757422 (diff)
downloadbcm5719-llvm-d437fa5c8c1185af695b87cdd5ea83aa4a6e7382.tar.gz
bcm5719-llvm-d437fa5c8c1185af695b87cdd5ea83aa4a6e7382.zip
Add an _LIBCPP_NORETURN inline function named __throw_XXX for each exception type we define. They either construct and throw the exception, or abort() (if exceptions are disabled). Use these functions everywhere instead of assert()ing when exceptions are disabled. WARNING: This is a behavior change - but only with exceptions disabled. Reviewed as: https://reviews.llvm.org/D23855.
llvm-svn: 279744
Diffstat (limited to 'libcxx/src/thread.cpp')
-rw-r--r--libcxx/src/thread.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/libcxx/src/thread.cpp b/libcxx/src/thread.cpp
index 467402b6b42..4775e10f6ab 100644
--- a/libcxx/src/thread.cpp
+++ b/libcxx/src/thread.cpp
@@ -53,10 +53,9 @@ thread::join()
if (ec == 0)
__t_ = 0;
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+
if (ec)
- throw system_error(error_code(ec, system_category()), "thread::join failed");
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_system_error(ec, "thread::join failed");
}
void
@@ -69,10 +68,9 @@ thread::detach()
if (ec == 0)
__t_ = 0;
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+
if (ec)
- throw system_error(error_code(ec, system_category()), "thread::detach failed");
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_system_error(ec, "thread::detach failed");
}
unsigned
OpenPOWER on IntegriCloud