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

Unified Diff: experimental/conways_life/threading/ref_count.h

Issue 10928195: First round of dead file removal (Closed) Base URL: https://github.com/samclegg/nativeclient-sdk.git@master
Patch Set: Created 8 years, 3 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
Index: experimental/conways_life/threading/ref_count.h
diff --git a/experimental/conways_life/threading/ref_count.h b/experimental/conways_life/threading/ref_count.h
deleted file mode 100644
index 6502af1e3a8b8edb8ada1d884781c565ba247bdc..0000000000000000000000000000000000000000
--- a/experimental/conways_life/threading/ref_count.h
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright (c) 2011 The Native Client 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 REF_COUNT_H_
-#define REF_COUNT_H_
-
-#include "experimental/conways_life/threading/scoped_mutex_lock.h"
-
-namespace threading {
-
-// A thread-safe reference counter for class CompletionCallbackFactory.
-class RefCount {
- public:
- RefCount() : ref_(0) {
- pthread_mutex_init(&mutex_, NULL);
- }
- ~RefCount() {
- pthread_mutex_destroy(&mutex_);
- }
-
- int32_t AddRef() {
- int32_t ret_val = 0;
- threading::ScopedMutexLock scoped_mutex(&mutex_);
- if (scoped_mutex.is_valid()) {
- ret_val = ++ref_;
- }
- return ret_val;
- }
-
- int32_t Release() {
- int32_t ret_val = -1;
- threading::ScopedMutexLock scoped_mutex(&mutex_);
- if (scoped_mutex.is_valid()) {
- ret_val = --ref_;
- }
- return ret_val;
- }
-
- private:
- int32_t ref_;
- pthread_mutex_t mutex_;
-};
-
-} // namespace threading
-#endif // REF_COUNT_H_
« no previous file with comments | « experimental/conways_life/threading/pthread_ext.h ('k') | experimental/conways_life/threading/scoped_mutex_lock.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698