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

Unified Diff: base/synchronization/lock_impl.h

Issue 1647803004: Move base to DEPS (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/synchronization/lock.cc ('k') | base/synchronization/lock_impl_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/synchronization/lock_impl.h
diff --git a/base/synchronization/lock_impl.h b/base/synchronization/lock_impl.h
deleted file mode 100644
index 42e2f99068b9981d2fff058d96a2ae9f2dd4df4e..0000000000000000000000000000000000000000
--- a/base/synchronization/lock_impl.h
+++ /dev/null
@@ -1,61 +0,0 @@
-// Copyright (c) 2011 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.
-
-#ifndef BASE_SYNCHRONIZATION_LOCK_IMPL_H_
-#define BASE_SYNCHRONIZATION_LOCK_IMPL_H_
-
-#include "build/build_config.h"
-
-#if defined(OS_WIN)
-#include <windows.h>
-#elif defined(OS_POSIX)
-#include <pthread.h>
-#endif
-
-#include "base/base_export.h"
-#include "base/basictypes.h"
-
-namespace base {
-namespace internal {
-
-// This class implements the underlying platform-specific spin-lock mechanism
-// used for the Lock class. Most users should not use LockImpl directly, but
-// should instead use Lock.
-class BASE_EXPORT LockImpl {
- public:
-#if defined(OS_WIN)
- typedef CRITICAL_SECTION NativeHandle;
-#elif defined(OS_POSIX)
- typedef pthread_mutex_t NativeHandle;
-#endif
-
- LockImpl();
- ~LockImpl();
-
- // If the lock is not held, take it and return true. If the lock is already
- // held by something else, immediately return false.
- bool Try();
-
- // Take the lock, blocking until it is available if necessary.
- void Lock();
-
- // Release the lock. This must only be called by the lock's holder: after
- // a successful call to Try, or a call to Lock.
- void Unlock();
-
- // Return the native underlying lock.
- // TODO(awalker): refactor lock and condition variables so that this is
- // unnecessary.
- NativeHandle* native_handle() { return &native_handle_; }
-
- private:
- NativeHandle native_handle_;
-
- DISALLOW_COPY_AND_ASSIGN(LockImpl);
-};
-
-} // namespace internal
-} // namespace base
-
-#endif // BASE_SYNCHRONIZATION_LOCK_IMPL_H_
« no previous file with comments | « base/synchronization/lock.cc ('k') | base/synchronization/lock_impl_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698