[mlir] Do not start threads in AsyncRuntime
authorEugene Zhulenev <ezhulenev@google.com>
Thu, 22 Oct 2020 15:17:53 +0000 (08:17 -0700)
committerEugene Zhulenev <ezhulenev@google.com>
Thu, 22 Oct 2020 15:31:30 +0000 (08:31 -0700)
pthreads is not enabled for all builds by default

Reviewed By: jpienaar

Differential Revision: https://reviews.llvm.org/D89967

mlir/lib/ExecutionEngine/AsyncRuntime.cpp

index 650fb39..b450a83 100644 (file)
@@ -59,8 +59,7 @@ mlirAsyncRuntimeAwaitToken(AsyncToken *token) {
 
 extern "C" MLIR_ASYNCRUNTIME_EXPORT void
 mlirAsyncRuntimeExecute(CoroHandle handle, CoroResume resume) {
-  std::thread thread([handle, resume]() { (*resume)(handle); });
-  thread.detach();
+  (*resume)(handle);
 }
 
 extern "C" MLIR_ASYNCRUNTIME_EXPORT void