From f330b76298ce76aa490c787dc10b5d018ab1d6e5 Mon Sep 17 00:00:00 2001 From: "jln@chromium.org" Date: Sat, 8 Feb 2014 04:52:46 +0000 Subject: Linux Sandbox: Stop GPU watchdog in accountable way. The Linux sandbox can sometimes detect a spurious running thread if it has just been stopped. We add a new LinuxSandbox::StopThread() method to safely stop threads and make sure they won't be counted as still running. BUG=328620 NOTRY=true Review URL: https://codereview.chromium.org/147203005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@249937 0039d316-1c4b-4281-b951-d872f2087c98 --- content/gpu/gpu_main.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'content/gpu') diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc index fdc7de4..8176221 100644 --- a/content/gpu/gpu_main.cc +++ b/content/gpu/gpu_main.cc @@ -409,13 +409,17 @@ bool StartSandboxLinux(const gpu::GPUInfo& gpu_info, WarmUpSandboxNvidia(gpu_info, should_initialize_gl_context); - if (watchdog_thread) - watchdog_thread->Stop(); + if (watchdog_thread) { + // LinuxSandbox needs to be able to ensure that the thread + // has really been stopped. + LinuxSandbox::StopThread(watchdog_thread); + } // LinuxSandbox::InitializeSandbox() must always be called // with only one thread. res = LinuxSandbox::InitializeSandbox(); - if (watchdog_thread) + if (watchdog_thread) { watchdog_thread->Start(); + } return res; } -- cgit v1.1