mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-15 15:16:12 -04:00
Avoid task execution to crash thread pool
PiperOrigin-RevId: 517980691
This commit is contained in:
committed by
Copybara-Service
parent
12156937ee
commit
465a82dc1e
@@ -16,7 +16,6 @@
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#include <exception>
|
||||
#include <queue>
|
||||
#include <utility>
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user