Salome HOME
PR: mergefrom branch BR_V3_1_0_PR tag mergeto_trunk_02feb06
[modules/yacs.git] / src / SALOMEDS / SALOMEDS_AttributeInteger.cxx
index b32650bcdc5ffe0175268f0fbe48264d51edaedd..f7d4addfb5e9291a0ba35c966daa17443d28a11a 100644 (file)
@@ -22,6 +22,7 @@
 //  Module : SALOME
 
 #include "SALOMEDS_AttributeInteger.hxx"
+#include "SALOMEDS.hxx"
 
 #include <TCollection_AsciiString.hxx>
 #include <TCollection_ExtendedString.hxx>
@@ -40,14 +41,20 @@ SALOMEDS_AttributeInteger::~SALOMEDS_AttributeInteger()
 int SALOMEDS_AttributeInteger::Value()
 {
   int aValue;
-  if(_isLocal) aValue = Handle(SALOMEDSImpl_AttributeInteger)::DownCast(_local_impl)->Value();
+  if (_isLocal) {
+    SALOMEDS::Locker lock; 
+    aValue = Handle(SALOMEDSImpl_AttributeInteger)::DownCast(_local_impl)->Value();
+  }
   else aValue = SALOMEDS::AttributeInteger::_narrow(_corba_impl)->Value();
   return aValue;
 }
+
 void SALOMEDS_AttributeInteger::SetValue(int value)
 {
-  CheckLocked();
-  if(_isLocal) Handle(SALOMEDSImpl_AttributeInteger)::DownCast(_local_impl)->SetValue(value);
+  if (_isLocal) {
+    CheckLocked();
+    SALOMEDS::Locker lock; 
+    Handle(SALOMEDSImpl_AttributeInteger)::DownCast(_local_impl)->SetValue(value);
+  }
   else SALOMEDS::AttributeInteger::_narrow(_corba_impl)->SetValue(value);
 }