summaryrefslogtreecommitdiffstats
path: root/base/lock_impl_win.cc
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-01 23:16:20 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-01 23:16:20 +0000
commitbc581a6829fe49e43f4869075781d6dc94843f09 (patch)
treea94363488dadff28fe2c03f3a169b6ad2eeb02e8 /base/lock_impl_win.cc
parent10f33b1bd6c6adb6306759a45bf3a5c18221d878 (diff)
downloadchromium_src-bc581a6829fe49e43f4869075781d6dc94843f09.zip
chromium_src-bc581a6829fe49e43f4869075781d6dc94843f09.tar.gz
chromium_src-bc581a6829fe49e43f4869075781d6dc94843f09.tar.bz2
Move base/lock and base/condition_variable to base/synchronization/
I kept a base/lock.h in place with a using statement to avoid updating all callers in one CL. TEST=it compiles BUG=none Review URL: http://codereview.chromium.org/6018013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70363 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/lock_impl_win.cc')
-rw-r--r--base/lock_impl_win.cc30
1 files changed, 0 insertions, 30 deletions
diff --git a/base/lock_impl_win.cc b/base/lock_impl_win.cc
deleted file mode 100644
index 8c03b61..0000000
--- a/base/lock_impl_win.cc
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright (c) 2010 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 "base/lock_impl.h"
-
-LockImpl::LockImpl() {
- // The second parameter is the spin count, for short-held locks it avoid the
- // contending thread from going to sleep which helps performance greatly.
- ::InitializeCriticalSectionAndSpinCount(&os_lock_, 2000);
-}
-
-LockImpl::~LockImpl() {
- ::DeleteCriticalSection(&os_lock_);
-}
-
-bool LockImpl::Try() {
- if (::TryEnterCriticalSection(&os_lock_) != FALSE) {
- return true;
- }
- return false;
-}
-
-void LockImpl::Lock() {
- ::EnterCriticalSection(&os_lock_);
-}
-
-void LockImpl::Unlock() {
- ::LeaveCriticalSection(&os_lock_);
-}