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

Side by Side Diff: remoting/host/local_input_monitor_thread_win.cc

Issue 8430019: Make LazyInstance managed Locks leaky. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « remoting/host/local_input_monitor_mac.mm ('k') | ui/gfx/gl/gl_implementation_linux.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "remoting/host/local_input_monitor_thread_win.h" 5 #include "remoting/host/local_input_monitor_thread_win.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 9
10 #include "base/synchronization/waitable_event.h" 10 #include "base/synchronization/waitable_event.h"
11 11
12 using namespace remoting; 12 using namespace remoting;
13 13
14 namespace { 14 namespace {
15 LocalInputMonitorThread* g_local_input_monitor_thread = NULL; 15 LocalInputMonitorThread* g_local_input_monitor_thread = NULL;
16 base::LazyInstance<base::Lock> g_thread_lock(base::LINKER_INITIALIZED); 16 base::LazyInstance<base::Lock,
17 base::LeakyLazyInstanceTraits<base::Lock> >
18 g_thread_lock(base::LINKER_INITIALIZED);
17 } // namespace 19 } // namespace
18 20
19 21
20 LocalInputMonitorThread::LocalInputMonitorThread() 22 LocalInputMonitorThread::LocalInputMonitorThread()
21 : base::SimpleThread("LocalInputMonitor") { 23 : base::SimpleThread("LocalInputMonitor") {
22 } 24 }
23 25
24 LocalInputMonitorThread::~LocalInputMonitorThread() { 26 LocalInputMonitorThread::~LocalInputMonitorThread() {
25 DCHECK(hosts_.empty()); 27 DCHECK(hosts_.empty());
26 } 28 }
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 107
106 void LocalInputMonitorThread::RemoveHostFromInputMonitor(ChromotingHost* host) { 108 void LocalInputMonitorThread::RemoveHostFromInputMonitor(ChromotingHost* host) {
107 DCHECK(g_local_input_monitor_thread); 109 DCHECK(g_local_input_monitor_thread);
108 base::AutoLock lock(g_thread_lock.Get()); 110 base::AutoLock lock(g_thread_lock.Get());
109 if (g_local_input_monitor_thread->RemoveHost(host)) { 111 if (g_local_input_monitor_thread->RemoveHost(host)) {
110 g_local_input_monitor_thread->Stop(); 112 g_local_input_monitor_thread->Stop();
111 delete g_local_input_monitor_thread; 113 delete g_local_input_monitor_thread;
112 g_local_input_monitor_thread = NULL; 114 g_local_input_monitor_thread = NULL;
113 } 115 }
114 } 116 }
OLDNEW
« no previous file with comments | « remoting/host/local_input_monitor_mac.mm ('k') | ui/gfx/gl/gl_implementation_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698