Revert back to r930. The last 2 commits were no good.
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Mon, 15 Oct 2007 07:23:59 +0000 (07:23 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Mon, 15 Oct 2007 07:23:59 +0000 (07:23 +0000)
git-svn-id: http://svn.voria.com/code@933 1f10aa63-cdf2-0310-b900-c93c546f37ac

ETL/trunk/ETL/_handle.h

index 13af09b..83a9ab5 100644 (file)
 
 /* === H E A D E R S ======================================================= */
 
-// include the next line in an attempt to increase stability
-#define ETL_LOCK_REFCOUNTS
-
 #include <cassert>
-#ifdef ETL_LOCK_REFCOUNTS
-#include <synfig/mutex.h>
-#endif
 
 /* === M A C R O S ========================================================= */
 
@@ -72,9 +66,6 @@ class shared_object
 {
 private:
        mutable int refcount;
-#ifdef ETL_LOCK_REFCOUNTS
-       mutable synfig::Mutex mutex;
-#endif
 
 protected:
        shared_object():refcount(0) { }
@@ -87,19 +78,11 @@ protected:
 
 public:
        void ref()const
-       {
-#ifdef ETL_LOCK_REFCOUNTS
-               synfig::Mutex::Lock lock(mutex);
-#endif
-               assert(refcount>=0); refcount++;
-       }
+               { assert(refcount>=0); refcount++; }
 
        //! Returns \c false if object needs to be deleted
        bool unref()const
        {
-#ifdef ETL_LOCK_REFCOUNTS
-               synfig::Mutex::Lock lock(mutex);
-#endif
                assert(refcount>0);
 
                refcount--;
@@ -107,9 +90,6 @@ public:
                if(refcount==0) {
 #ifdef ETL_SELF_DELETING_SHARED_OBJECT
                        refcount=-666;
-#ifdef ETL_LOCK_REFCOUNTS
-                       mutex.unlock();
-#endif
                        delete this;
 #endif
                        return false;
@@ -119,12 +99,7 @@ public:
        }
 
        int count()const
-       { 
-#ifdef ETL_LOCK_REFCOUNTS
-               synfig::Mutex::Lock lock(mutex);
-#endif
-               return refcount;
-       }
+               { return refcount; }
 }; // END of class shared_object
 
 // ========================================================================