add lock for smp safety
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>
Tue, 27 Feb 2007 15:39:02 +0000 (15:39 +0000)
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>
Tue, 27 Feb 2007 15:39:02 +0000 (15:39 +0000)
lib/base/object.h

index 8ac92b8..67a4606 100644 (file)
@@ -149,14 +149,14 @@ public:
                        void c::AddRef() \
                        { \
                                __asm__ __volatile__( \
-                               "               incl    %0      \n" \
+                               "               lock ; incl     %0      \n" \
                                : "=m" (ref.count) \
                                : "m" (ref.count); \
                        } \
                        void c::Release() \
                        { \
                                __asm__ __volatile__( \
-                               "               decl    %0      \n" \
+                               "               lock ; decl     %0      \n" \
                                : "=m" (ref.count) \
                                : "m" (ref.count); \
                                if (!ref) \