Author: DerekRhodes Date: 2008-03-05 18:05:54 -0500 (Wed, 05 Mar 2008) New Revision: 1057
Modified: trunk/pysoy/src/atoms/Face.pxi Log: locks changed for Children API Modified: trunk/pysoy/src/atoms/Face.pxi =================================================================== --- trunk/pysoy/src/atoms/Face.pxi 2008-03-05 22:32:04 UTC (rev 1056) +++ trunk/pysoy/src/atoms/Face.pxi 2008-03-05 23:05:54 UTC (rev 1057) @@ -40,8 +40,10 @@ raise TypeError('must provide verticies and material for a new Face') if not isinstance(material, soy.materials.Material) : raise TypeError('material must be of type soy.materials.Material') - self._list._children.lock() - mesh._mates._children.lock() + ##self._list._children.lock() + ##mesh._mates._children.lock() + self._list._children._stepLock() + mesh._mates._children._stepLock() self._list._children.append(<void *>self) self._list._allocArray(self._list._arraySize + 1) _mindex = mesh._mates._children.index(<void *> material) @@ -72,8 +74,10 @@ self._list._arraySize = self._list._arraySize + 1 self._list._flagUpdated(self._index, self._list._arraySize-self._index) # - mesh._mates._children.unlock() - self._list._children.unlock() + ##mesh._mates._children.unlock() + ##self._list._children.unlock() + mesh._mates._children._stepUnlock() + self._list._children._stepUnlock() self.verts = verts @@ -92,11 +96,13 @@ cdef object t cdef soy._datatypes.VertexList _verts _verts = (<soy.meshes.Mesh> self._list._mesh)._verts - self._list._children.lock() + ##self._list._children.lock() + self._list._children._stepLock() t = (_verts[self._list._array[self._index].a], _verts[self._list._array[self._index].b], _verts[self._list._array[self._index].c]) - self._list._children.unlock() + ##self._list._children.unlock() + self._list._children._stepUnlock() return t def __set__(self, value) : cdef int i @@ -107,12 +113,14 @@ for i from 0 <= i < 3 : if type(value[i]) != Vertex : raise TypeError('All three elements must be of type Vertex') - self._list._children.lock() + ##self._list._children.lock() + self._list._children._stepLock() self._list._array[self._index].a = (<Vertex> value[0])._index self._list._array[self._index].b = (<Vertex> value[1])._index self._list._array[self._index].c = (<Vertex> value[2])._index self._list._flagUpdated(self._index, 1) - self._list._children.unlock() + ##self._list._children.unlock() + self._list._children._stepUnlock() property material : @@ -122,15 +130,19 @@ cdef soy._datatypes.MaterialList mlist cdef soy._datatypes.Face _face mlist = (<soy.meshes.Mesh> self._list._mesh)._mates - self._list._children.lock() - mlist._children.lock() + ##self._list._children.lock() + ##mlist._children.lock() + self._list._children._stepLock() + mlist._children.stepLock() for i from 0 <= i < mlist._children.current : if self._index >= mlist._ranges[i].offset and \ self._index < mlist._ranges[i].offset + mlist._ranges[i].length : material = <soy.materials.Material> mlist._children.list[i] break - self._list._children.unlock() - mlist._children.unlock() + ##self._list._children.unlock() + ##mlist._children.unlock() + self._list._children._stepUnlock() + mlist._children._stepUnlock() if material : return material else : @@ -140,8 +152,10 @@ cdef soy._datatypes.Face _face cdef soy._datatypes.MaterialList mlist mlist = (<soy.meshes.Mesh> self._list._mesh)._mates - self._list._children.lock() - mlist._children.lock() + ##self._list._children.lock() + ##mlist._children.lock() + self._list._children._stepLock() + mlist._children._stepLock() _mindex = -1 _oldindex = self._index _face = self._list._array[self._index] @@ -151,8 +165,10 @@ _mindex = i break if _mindex == -1 : - self._list._children.unlock() - mlist._children.unlock() + ##self._list._children.unlock() + ##mlist._children.unlock() + self._list._children._stepUnlock() + mlist._children._stepUnlock() raise RuntimeError('This error should never happen. ' + \ 'Please file a ticket on www.pysoy.org') # @@ -212,11 +228,7 @@ self._list._array[i+1] = self._list._array[i] self._list._array[self._index] = _face self._list._flagUpdated(self._index, _oldindex - self._index + 1) - self._list._children.unlock() - mlist._children.unlock() - -# DIRTY! 43-76 -# DIRTY! 95-99 -# DIRTY! 110-115 -# DIRTY! 125-133 -# DIRTY! 143-216 + ##self._list._children.unlock() + ##mlist._children.unlock() + self._list._children._stepUnlock() + mlist._children._stepUnlock() _______________________________________________ PySoy-SVN mailing list PySoy-SVN@pysoy.org http://www.pysoy.org/mailman/listinfo/pysoy-svn