Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Unified Diff: gpu/ipc/service/gpu_init.cc

Issue 2857743004: Workaround for UCRT deadlock between gpu's main and watchdog threads (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/ipc/service/gpu_init.cc
diff --git a/gpu/ipc/service/gpu_init.cc b/gpu/ipc/service/gpu_init.cc
index 4588f9aa0abda62809038b6e031df8ea93f4c518..020f414388b48a1c51cba95ea39001a4328d4f5e 100644
--- a/gpu/ipc/service/gpu_init.cc
+++ b/gpu/ipc/service/gpu_init.cc
@@ -163,8 +163,22 @@ bool GpuInit::InitializeAndStartSandbox(const base::CommandLine& command_line) {
// Start the GPU watchdog only after anything that is expected to be time
// consuming has completed, otherwise the process is liable to be aborted.
- if (enable_watchdog && !delayed_watchdog_enable)
+ if (enable_watchdog && !delayed_watchdog_enable) {
watchdog_thread_ = gpu::GpuWatchdogThread::Create();
+#if defined(OS_WIN)
+ // This is a workaround for an occasional deadlock between watchdog and
+ // current thread. Watchdog hangs at thread initialization in
+ // __acrt_thread_attach() and current thread in std::setlocale(...)
+ // (during InitializeGLOneOff()). Source of the deadlock looks like an old
+ // UCRT bug that was supposed to be fixed in 10.0.10586 release of UCRT,
+ // but we might have come accross a not-yet-covered scenario.
Ken Russell (switch to Gerrit) 2017/05/04 17:18:48 Please refer to crbug.com/718388 in the comment, i
+ // References:
+ // https://bugs.python.org/issue26624
+ // http://stackoverflow.com/questions/35572792/setlocale-stuck-on-windows
+ auto watchdog_started = watchdog_thread_->WaitUntilThreadStarted();
+ DCHECK(watchdog_started);
+#endif // OS_WIN
+ }
// Get vendor_id, device_id, driver_version from browser process through
// commandline switches.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698