From 465a82dc1ea49e7ca47b2abf2ec58639ff000490 Mon Sep 17 00:00:00 2001 From: Guogang Li Date: Mon, 20 Mar 2023 08:51:13 -0700 Subject: [PATCH] Avoid task execution to crash thread pool PiperOrigin-RevId: 517980691 --- .../platform/implementation/windows/thread_pool.cc | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/internal/platform/implementation/windows/thread_pool.cc b/internal/platform/implementation/windows/thread_pool.cc index fe2729a0..e32511ad 100644 --- a/internal/platform/implementation/windows/thread_pool.cc +++ b/internal/platform/implementation/windows/thread_pool.cc @@ -16,7 +16,6 @@ #include -#include #include #include @@ -24,7 +23,6 @@ #include "absl/synchronization/mutex.h" #include "internal/platform/logging.h" #include "internal/platform/runnable.h" -#include "winrt/base.h" namespace nearby { namespace windows { @@ -159,16 +157,7 @@ void ThreadPool::RunNextTask() { return; } - try { - task(); - } catch (std::exception exception) { - NEARBY_LOGS(ERROR) << __func__ << ": Exception: " << exception.what(); - } catch (const winrt::hresult_error& error) { - NEARBY_LOGS(ERROR) << __func__ << ": WinRT exception: " << error.code() - << ": " << winrt::to_string(error.message()); - } catch (...) { - NEARBY_LOGS(ERROR) << __func__ << ": Unknown exeption."; - } + task(); } } // namespace windows