The lock is actually a threading.RLock object, which allows the same 
thread to acquire the lock multiple times as long as it releases it the same 
number of times.  So this isn't a bug.

Someone on comp.lang.python once said that the only synchronization objects 
you ever need in Python are RLock and Queue.  I tend to agree.

- Geoff


On Friday March 15, 2002 09:30 pm, Tavis Rudd wrote:
> Hi,
> I just noticed what looks like a thread conflict in the cvs version
> of SessionDynamicStore.py at 158, storeAllSessions.  It acquires the
> lock and then calls MoveToFile, which will wait until it can acquire
> the lock:
>
>       def MovetoFile(self, key):
>               self._lock.acquire()
>               try:
>                       global debug
>                       if debug: print ">> Moving %s to File" % key
>                       self._fileStore[key] = self._memoryStore[key]
>                       del self._memoryStore[key]
>               finally:
>                       self._lock.release()
>
>
>
>       ## Application support ##
>
>       def storeSession(self, session):
>               pass
>
>       def storeAllSessions(self):
>               self._lock.acquire()
>               try:
>                       for i in self._memoryStore.keys():
>                               self.MovetoFile(i)
>               finally:
>                       self._lock.release()
> Tavis

_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to