summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/CrashRecoveryContext.cpp
diff options
context:
space:
mode:
authorSam McCall <sammccall@google.com>2019-10-23 15:34:48 +0200
committerSam McCall <sammccall@google.com>2019-10-23 15:51:44 +0200
commita9c3c176ad741b9c2b915abc59dd977d0299c53f (patch)
tree9b3ea3806dcff715124291d8ed990d771165add2 /llvm/lib/Support/CrashRecoveryContext.cpp
parent10c8dbcb840c744002a824950e8293ef0a1fd61a (diff)
downloadbcm5719-llvm-a9c3c176ad741b9c2b915abc59dd977d0299c53f.tar.gz
bcm5719-llvm-a9c3c176ad741b9c2b915abc59dd977d0299c53f.zip
Reland "[Support] Add a way to run a function on a detached thread""
This reverts commit 7bc7fe6b789d25d48d6dc71d533a411e9e981237. The immediate callers have been fixed to pass nullopt where appropriate.
Diffstat (limited to 'llvm/lib/Support/CrashRecoveryContext.cpp')
-rw-r--r--llvm/lib/Support/CrashRecoveryContext.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Support/CrashRecoveryContext.cpp b/llvm/lib/Support/CrashRecoveryContext.cpp
index 9d13fce9cc5..8d8529b474f 100644
--- a/llvm/lib/Support/CrashRecoveryContext.cpp
+++ b/llvm/lib/Support/CrashRecoveryContext.cpp
@@ -404,7 +404,10 @@ bool CrashRecoveryContext::RunSafelyOnThread(function_ref<void()> Fn,
unsigned RequestedStackSize) {
bool UseBackgroundPriority = hasThreadBackgroundPriority();
RunSafelyOnThreadInfo Info = { Fn, this, UseBackgroundPriority, false };
- llvm_execute_on_thread(RunSafelyOnThread_Dispatch, &Info, RequestedStackSize);
+ llvm_execute_on_thread(RunSafelyOnThread_Dispatch, &Info,
+ RequestedStackSize == 0
+ ? llvm::None
+ : llvm::Optional<unsigned>(RequestedStackSize));
if (CrashRecoveryContextImpl *CRC = (CrashRecoveryContextImpl *)Impl)
CRC->setSwitchedThread();
return Info.Result;
OpenPOWER on IntegriCloud