Typo.
[synfig.git] / ETL / trunk / ETL / _handle.h
index 13af09b..7eb7110 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
 
 // ========================================================================
@@ -411,7 +386,7 @@ private:
 
        void add_to_rlist()
        {
-//             value_type*& obj(handle<T>::obj); // Required to keep gcc 3.4.2 form barfing
+//             value_type*& obj(handle<T>::obj); // Required to keep gcc 3.4.2 from barfing
 
                assert(obj);
                obj->rref();
@@ -432,7 +407,7 @@ private:
 
        void del_from_rlist()
        {
-//             value_type*& obj(handle<T>::obj); // Required to keep gcc 3.4.2 form barfing
+//             value_type*& obj(handle<T>::obj); // Required to keep gcc 3.4.2 from barfing
                assert(obj);
                obj->runref();
 
@@ -463,20 +438,20 @@ public:
        //! Constructor that constructs from a pointer to new object
        rhandle(pointer x):handle<T>(x)
        {
-//             value_type*& obj(handle<T>::obj); // Required to keep gcc 3.4.2 form barfing
+//             value_type*& obj(handle<T>::obj); // Required to keep gcc 3.4.2 from barfing
                if(obj)add_to_rlist();
        }
 
        rhandle(const handle<value_type> &x):handle<T>(x)
        {
-//             value_type*& obj(handle<T>::obj); // Required to keep gcc 3.4.2 form barfing
+//             value_type*& obj(handle<T>::obj); // Required to keep gcc 3.4.2 from barfing
                if(obj)add_to_rlist();
        }
 
        //! Default copy constructor
        rhandle(const rhandle<value_type> &x):handle<T>(x)
        {
-//             value_type*& obj(handle<T>::obj); // Required to keep gcc 3.4.2 form barfing
+//             value_type*& obj(handle<T>::obj); // Required to keep gcc 3.4.2 from barfing
                if(obj)add_to_rlist();
        }
 
@@ -510,7 +485,7 @@ public:
        rhandle<value_type> &
        operator=(const rhandle<value_type> &x)
        {
-//             value_type*& obj(handle<T>::obj); // Required to keep gcc 3.4.2 form barfing
+//             value_type*& obj(handle<T>::obj); // Required to keep gcc 3.4.2 from barfing
                if(x.get()==obj)
                        return *this;
 
@@ -528,7 +503,7 @@ public:
        rhandle<value_type>&
        operator=(const handle<value_type> &x)
        {
-//             value_type*& obj(handle<T>::obj); // Required to keep gcc 3.4.2 form barfing
+//             value_type*& obj(handle<T>::obj); // Required to keep gcc 3.4.2 from barfing
                if(x.get()==obj)
                        return *this;
 
@@ -546,7 +521,7 @@ public:
        rhandle<value_type>&
        operator=(value_type* x)
        {
-//             value_type*& obj(handle<T>::obj); // Required to keep gcc 3.4.2 form barfing
+//             value_type*& obj(handle<T>::obj); // Required to keep gcc 3.4.2 from barfing
                if(x==obj)
                        return *this;
 
@@ -566,7 +541,7 @@ public:
        void
        detach()
        {
-//             value_type*& obj(handle<T>::obj); // Required to keep gcc 3.4.2 form barfing
+//             value_type*& obj(handle<T>::obj); // Required to keep gcc 3.4.2 from barfing
                if(obj)del_from_rlist();
                handle<value_type>::detach();
                obj=0;
@@ -585,7 +560,7 @@ public:
        count_type
        rcount()const
        {
-//             value_type*const& obj(handle<T>::obj); // Required to keep gcc 3.4.2 form barfing
+//             value_type*const& obj(handle<T>::obj); // Required to keep gcc 3.4.2 from barfing
                return obj?obj->rcount():0;
        }
 
@@ -593,14 +568,14 @@ public:
        bool
        runique()const
        {
-//             value_type*& obj(handle<T>::obj); // Required to keep gcc 3.4.2 form barfing
+//             value_type*& obj(handle<T>::obj); // Required to keep gcc 3.4.2 from barfing
                assert(obj); return obj->front_==obj->back_;
        }
 
        //! \writeme
        int replace(const handle<value_type> &x)
        {
-//             value_type*& obj(handle<T>::obj); // Required to keep gcc 3.4.2 form barfing
+//             value_type*& obj(handle<T>::obj); // Required to keep gcc 3.4.2 from barfing
                assert(obj);
                assert(x.get()!=obj);