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

Side by Side Diff: ppapi/shared_impl/proxy_lock.cc

Issue 8016008: Make much of the proxy thread-safe with 1 great big lock. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 9 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ppapi/shared_impl/proxy_lock.h ('k') | ppapi/thunk/enter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "ppapi/shared_impl/proxy_lock.h"
6
7 #include "base/synchronization/lock.h"
8
9 namespace ppapi {
10
11 base::Lock* ProxyLock::lock_ = NULL;
12
13 // static
14 void ProxyLock::Acquire() {
15 if (lock_)
16 lock_->Acquire();
17 }
18
19 // static
20 void ProxyLock::Release() {
21 if (lock_)
22 lock_->Release();
23 }
24
25 // static
26 void ProxyLock::Set(base::Lock* lock) {
27 lock_ = lock;
28 }
29
30 // static
31 void ProxyLock::Reset() {
32 Set(NULL);
33 }
34
35 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/shared_impl/proxy_lock.h ('k') | ppapi/thunk/enter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698