On 2011-02-08, Jason Heeris wrote: > On 8 February 2011 10:45, Jason Rennie <jren...@gmail.com> wrote: > > I think what you have duplicating functionality---you're not taking > > advantage of the DeferredSemaphore. > > I thought using the "run" method *was* the preferred way to use a DS, > but whatever works. > > > > Shouldn't this be spelled: > > > > d = sem.run(doSerialStuff) > > > > Which does acquasition and release of the sempahore properly? > > Won't you then be trying to acquire or release it twice?
Um, that's what I mean, you shouldn't be using .acquire() or .release(), just .run(). doSerialStuff doesn't need a reference to the semaphore object. -- Regards, Stephen Thorne Development Engineer Netbox Blue _______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python