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

Side by Side Diff: gpu/command_buffer/client/atomicops.h

Issue 59383006: Delete gpu/command_buffer/client/atomicops.h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 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 | « no previous file | gpu/command_buffer/client/atomicops.cc » ('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) 2012 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 #ifndef GPU_COMMAND_BUFFER_CLIENT_ATOMICOPS_H_
6 #define GPU_COMMAND_BUFFER_CLIENT_ATOMICOPS_H_
7
8 #include "base/memory/scoped_ptr.h"
9 #include "gpu/command_buffer/common/types.h"
10 #include "gpu/gpu_export.h"
11
12 namespace gpu {
13
14 class LockImpl;
15 class GPU_EXPORT Lock {
16 public:
17 Lock();
18 ~Lock();
19 void Acquire();
20 void Release();
21 bool Try();
22 void AssertAcquired() const;
23
24 private:
25 scoped_ptr<LockImpl> lock_;
26
27 DISALLOW_COPY_AND_ASSIGN(Lock);
28 };
29
30 // A helper class that acquires the given Lock while the AutoLock is in scope.
31 class GPU_EXPORT AutoLock {
32 public:
33 explicit AutoLock(Lock& lock) : lock_(lock) {
34 lock_.Acquire();
35 }
36
37 ~AutoLock() {
38 lock_.AssertAcquired();
39 lock_.Release();
40 }
41
42 private:
43 Lock& lock_;
44 DISALLOW_COPY_AND_ASSIGN(AutoLock);
45 };
46
47 } // namespace gpu
48
49 #endif // GPU_COMMAND_BUFFER_CLIENT_ATOMICOPS_H_
OLDNEW
« no previous file with comments | « no previous file | gpu/command_buffer/client/atomicops.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698