Author ssoria
Recipients janssen, loewis, ssoria
Date 2010-01-11.17:43:46
SpamBayes Score 9.56062e-07
Marked as misclassified No
Message-id <1263231829.34.0.339866716808.issue7672@psf.upfronthosting.co.za>
In-reply-to
Content
Okay, what if I attack this problem from a "it's not thread-safe" point of view? If the callbacks are already loaded, then who knows what state the locks are in. If you replace the locking_callback while a thread already has the lock, and another thread comes in and tries to lock, it will succeed immediately, and two threads will be in the critical section.

Attaching a patch for how I think this should work.

From Bill via email:
Hmmm, well, is there a standard way to unload Python?  I could put a
__del__ method on the module which would remove the callbacks, I
suppose.  I just never heard of "unloading" a module before.
History
Date User Action Args
2010-01-11 17:43:49ssoriasetrecipients: + ssoria, loewis, janssen
2010-01-11 17:43:49ssoriasetmessageid: <1263231829.34.0.339866716808.issue7672@psf.upfronthosting.co.za>
2010-01-11 17:43:48ssorialinkissue7672 messages
2010-01-11 17:43:47ssoriacreate