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

Unified Diff: rlz/lib/recursive_lock.cc

Issue 11308196: [cros] RlzValueStore made protected by a cross-process lock and not persisted over browser lifetime… (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « rlz/lib/recursive_lock.h ('k') | rlz/lib/recursive_lock_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: rlz/lib/recursive_lock.cc
diff --git a/rlz/lib/recursive_lock.cc b/rlz/lib/recursive_lock.cc
deleted file mode 100644
index 686cf0ebba26da2688f4fe204742c75009b57971..0000000000000000000000000000000000000000
--- a/rlz/lib/recursive_lock.cc
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "rlz/lib/recursive_lock.h"
-
-#include "base/logging.h"
-
-namespace rlz_lib {
-
-RecursiveLock::RecursiveLock()
- : owner_(),
- recursion_() {
-}
-
-RecursiveLock::~RecursiveLock() {
-}
-
-void RecursiveLock::Acquire() {
- base::subtle::Atomic32 me = base::PlatformThread::CurrentId();
- if (me != base::subtle::NoBarrier_Load(&owner_)) {
- lock_.Acquire();
- DCHECK(!recursion_);
- DCHECK(!owner_);
- base::subtle::NoBarrier_Store(&owner_, me);
- }
- ++recursion_;
-}
-
-void RecursiveLock::Release() {
- DCHECK_EQ(base::subtle::NoBarrier_Load(&owner_),
- base::PlatformThread::CurrentId());
- DCHECK_GT(recursion_, 0);
- if (!--recursion_) {
- base::subtle::NoBarrier_Store(&owner_, 0);
- lock_.Release();
- }
-}
-
-} // namespace rlz_lib
« no previous file with comments | « rlz/lib/recursive_lock.h ('k') | rlz/lib/recursive_lock_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698