diff options
author | Sam McCall <sammccall@google.com> | 2019-10-23 15:34:48 +0200 |
---|---|---|
committer | Sam McCall <sammccall@google.com> | 2019-10-23 15:51:44 +0200 |
commit | a9c3c176ad741b9c2b915abc59dd977d0299c53f (patch) | |
tree | 9b3ea3806dcff715124291d8ed990d771165add2 /llvm/lib/Support/CrashRecoveryContext.cpp | |
parent | 10c8dbcb840c744002a824950e8293ef0a1fd61a (diff) | |
download | bcm5719-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.cpp | 5 |
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; |