summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--base/ref_counted.cc7
-rw-r--r--base/ref_counted.h3
-rw-r--r--base/revocable_store.h2
3 files changed, 11 insertions, 1 deletions
diff --git a/base/ref_counted.cc b/base/ref_counted.cc
index dfb3698..597c92c 100644
--- a/base/ref_counted.cc
+++ b/base/ref_counted.cc
@@ -5,6 +5,7 @@
#include "base/ref_counted.h"
#include "base/logging.h"
+#include "base/thread_collision_warner.h"
namespace base {
@@ -23,6 +24,9 @@ RefCountedBase::~RefCountedBase() {
}
void RefCountedBase::AddRef() {
+ // TODO(maruel): Add back once it doesn't assert 500 times/sec.
+ // Current thread books the critical section "AddRelease" without release it.
+ // DFAKE_SCOPED_LOCK_THREAD_LOCKED(add_release_);
#ifndef NDEBUG
DCHECK(!in_dtor_);
#endif
@@ -30,6 +34,9 @@ void RefCountedBase::AddRef() {
}
bool RefCountedBase::Release() {
+ // TODO(maruel): Add back once it doesn't assert 500 times/sec.
+ // Current thread books the critical section "AddRelease" without release it.
+ // DFAKE_SCOPED_LOCK_THREAD_LOCKED(add_release_);
#ifndef NDEBUG
DCHECK(!in_dtor_);
#endif
diff --git a/base/ref_counted.h b/base/ref_counted.h
index 2268808..853fa90 100644
--- a/base/ref_counted.h
+++ b/base/ref_counted.h
@@ -7,6 +7,7 @@
#include "base/atomic_ref_count.h"
#include "base/basictypes.h"
+#include "base/thread_collision_warner.h"
namespace base {
@@ -28,6 +29,8 @@ class RefCountedBase {
bool in_dtor_;
#endif
+ DFAKE_MUTEX(add_release_);
+
DISALLOW_COPY_AND_ASSIGN(RefCountedBase);
};
diff --git a/base/revocable_store.h b/base/revocable_store.h
index 2ee9705..60ada5c 100644
--- a/base/revocable_store.h
+++ b/base/revocable_store.h
@@ -17,7 +17,7 @@ class RevocableStore {
// store wishes to revoke its items, it sets |store_| to null. Items are
// permitted to release their reference to the |StoreRef| when they no longer
// require the store.
- class StoreRef : public base::RefCountedThreadSafe<StoreRef> {
+ class StoreRef : public base::RefCounted<StoreRef> {
public:
StoreRef(RevocableStore* store) : store_(store) { }