Re: [Tutor] locks and threads

2008-08-02 Thread Kent Johnson
On Sat, Aug 2, 2008 at 2:36 PM, James <[EMAIL PROTECTED]> wrote: > All, > > I'm trying to write a class that will acquire a lock before entering a > critical section, and then release it. Does this look like the right > way to go about accomplishing my goal? > > try: > grabLock = self.lock.acquire(

[Tutor] locks and threads

2008-08-02 Thread James
All, I'm trying to write a class that will acquire a lock before entering a critical section, and then release it. Does this look like the right way to go about accomplishing my goal? try: grabLock = self.lock.acquire( 0 ) if grabLock: print 'acquired lock successfully'