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

Unified Diff: gpu/command_buffer/client/atomicops.cc

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/command_buffer/client/atomicops.h ('k') | gpu/command_buffer/client/buffer_tracker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/client/atomicops.cc
diff --git a/gpu/command_buffer/client/atomicops.cc b/gpu/command_buffer/client/atomicops.cc
deleted file mode 100644
index c66fc05738e5b9e1ed210d221bc7f7d783c1c9de..0000000000000000000000000000000000000000
--- a/gpu/command_buffer/client/atomicops.cc
+++ /dev/null
@@ -1,92 +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 "gpu/command_buffer/client/atomicops.h"
-
-#include "base/logging.h"
-
-#if !defined(__native_client__)
-#include "base/atomicops.h"
-#include "base/synchronization/lock.h"
-#else
-#include <pthread.h>
-#endif
-
-namespace gpu {
-
-#if defined(__native_client__)
-
-class LockImpl {
- public:
- LockImpl()
- : acquired_(false) {
- pthread_mutex_init(&mutex_, NULL);
- }
-
- ~LockImpl() {
- pthread_mutex_destroy(&mutex_);
- }
-
- void Acquire() {
- pthread_mutex_lock(&mutex_);
- acquired_ = true;
- }
-
- void Release() {
- DCHECK(acquired_);
- acquired_ = false;
- pthread_mutex_unlock(&mutex_);
- }
-
- bool Try() {
- bool acquired = pthread_mutex_trylock(&mutex_) == 0;
- if (acquired) {
- acquired_ = true;
- }
- return acquired;
- }
-
- void AssertAcquired() const {
- DCHECK(acquired_);
- }
-
- private:
- bool acquired_;
- pthread_mutex_t mutex_;
-
- DISALLOW_COPY_AND_ASSIGN(LockImpl);
-};
-
-#else // !__native_client__
-
-class LockImpl : public base::Lock {
-};
-
-#endif // !__native_client__
-
-Lock::Lock()
- : lock_(new LockImpl()) {
-}
-
-Lock::~Lock() {
-}
-
-void Lock::Acquire() {
- lock_->Acquire();
-}
-
-void Lock::Release() {
- lock_->Release();
-}
-
-bool Lock::Try() {
- return lock_->Try();
-}
-
-void Lock::AssertAcquired() const {
- return lock_->AssertAcquired();
-}
-
-} // namespace gpu
-
« no previous file with comments | « gpu/command_buffer/client/atomicops.h ('k') | gpu/command_buffer/client/buffer_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698