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

Side by Side Diff: rlz/lib/recursive_lock.h

Issue 11361057: [cros] Add RecursiveLock for CrOS implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge Created 8 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 | rlz/lib/recursive_lock.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 RLZ_CHROMEOS_LIB_RECURSIVE_LOCK_H_
6 #define RLZ_CHROMEOS_LIB_RECURSIVE_LOCK_H_
7
8 #include "base/atomicops.h"
9 #include "base/basictypes.h"
10 #include "base/synchronization/lock.h"
11
12 namespace rlz_lib {
13
14
15 class RecursiveLock {
16 public:
17 RecursiveLock();
18 ~RecursiveLock();
19
20 void Acquire();
21 void Release();
22
23 private:
24 // Underlying non-recursive lock.
25 base::Lock lock_;
26 // Owner thread ID.
27 base::subtle::Atomic32 owner_;
28 // Recursion lock depth.
29 int recursion_;
30 };
31
32 } // namespace rlz_lib
33
34 #endif // RLZ_CHROMEOS_LIB_RECURSIVE_LOCK_H_
OLDNEW
« no previous file with comments | « no previous file | rlz/lib/recursive_lock.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698