From 66c503950a4b40eea7478c9e99d3640d0b405ac8 Mon Sep 17 00:00:00 2001 From: FuzzTest Team Date: Mon, 20 Jul 2026 11:26:46 -0700 Subject: [PATCH] No public description PiperOrigin-RevId: 950954863 --- fuzztest/internal/runtime.cc | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/fuzztest/internal/runtime.cc b/fuzztest/internal/runtime.cc index f03dbaf18..00e2026cd 100644 --- a/fuzztest/internal/runtime.cc +++ b/fuzztest/internal/runtime.cc @@ -383,7 +383,18 @@ void Runtime::PrintReport(RawSink out) const { absl::Format(out, "%s", GetSeparator()); } -#ifndef FUZZTEST_USE_CENTIPEDE +#if defined(FUZZTEST_USE_CENTIPEDE) || \ + ((defined(__EMSCRIPTEN__) || defined(__wasm__) || defined(__wasm32__)) && \ + !defined(__EMSCRIPTEN_PTHREADS__)) + +// Centipede runner has its own watchdog. Single-threaded WebAssembly (without +// __EMSCRIPTEN_PTHREADS__) does not support threads. +class Runtime::Watchdog { + public: + explicit Watchdog(Runtime&) {} +}; + +#else class Runtime::Watchdog { public: @@ -419,15 +430,7 @@ class Runtime::Watchdog { Runtime& runtime_; }; -#else // FUZZTEST_USE_CENTIPEDE - -// Centipede runner has its own watchdog. -class Runtime::Watchdog { - public: - explicit Watchdog(Runtime&) {} -}; - -#endif // FUZZTEST_USE_CENTIPEDE +#endif // FUZZTEST_USE_CENTIPEDE || __EMSCRIPTEN__ || __wasm__ || __wasm32__ Runtime::Watchdog Runtime::CreateWatchdog() { return Watchdog{*this}; }