| Index: native_client_sdk/src/libraries/sdk_util/ref_object.h
|
| diff --git a/native_client_sdk/src/libraries/sdk_util/ref_object.h b/native_client_sdk/src/libraries/sdk_util/ref_object.h
|
| index e446e8014176a68e4cdca6681a80539fc8dd6167..88fcee9b8e1112b375fb7960e297234351afefed 100644
|
| --- a/native_client_sdk/src/libraries/sdk_util/ref_object.h
|
| +++ b/native_client_sdk/src/libraries/sdk_util/ref_object.h
|
| @@ -16,9 +16,8 @@ class ScopedRefBase;
|
| /*
|
| * RefObject
|
| *
|
| - * A reference counted object with a lock. The lock protects the data within
|
| - * the object, but not the reference counting which happens through atomic
|
| - * operations. RefObjects should only be handled by ScopedRef objects.
|
| + * A reference counted object. RefObjects should only be handled by ScopedRef
|
| + * objects.
|
| *
|
| * When the object is first created, it has a reference count of zero. It's
|
| * first incremented when it gets assigned to a ScopedRef. When the last
|
| @@ -29,7 +28,6 @@ class RefObject {
|
| public:
|
| RefObject() {
|
| ref_count_ = 0;
|
| - pthread_mutex_init(&lock_, NULL);
|
| }
|
|
|
| /*
|
| @@ -44,6 +42,11 @@ class RefObject {
|
| int RefCount() const { return ref_count_; }
|
|
|
| protected:
|
| + virtual ~RefObject() {}
|
| +
|
| + // Override to clean up object when last reference is released.
|
| + virtual void Destroy() {}
|
| +
|
| void Acquire() {
|
| AtomicAddFetch(&ref_count_, 1);
|
| }
|
| @@ -58,14 +61,6 @@ class RefObject {
|
| return true;
|
| }
|
|
|
| - virtual ~RefObject() {
|
| - pthread_mutex_destroy(&lock_);
|
| - }
|
| -
|
| - // Override to clean up object when last reference is released.
|
| - virtual void Destroy() {}
|
| - pthread_mutex_t lock_;
|
| -
|
| private:
|
| Atomic32 ref_count_;
|
|
|
|
|