Re: Question about mutexes

2005-06-01 Thread Jan Danielsson
Reinhold Birkenfeld wrote: [---] >>How would I go about doing that in Python? > > I think you will want to create a threading.Lock object. It would seem so. Thanks for the tip! -- http://mail.python.org/mailman/listinfo/python-list

Re: Question about mutexes

2005-06-01 Thread Reinhold Birkenfeld
Jan Danielsson wrote: > In OS/2 C, I would do this: > > main() > { > ... > DosCreateMutexSem(NULL, &hmtx, 0UL, FALSE); > ... > } > > thread() > { > ... > DosRequestMutexSem(hmtx); > > Locked! > > DosReleaseMutexSem(hmtx); > ... > } > > How would I go about doing that in Python? I think you wi

Question about mutexes

2005-06-01 Thread Jan Danielsson
In OS/2 C, I would do this: main() { ... DosCreateMutexSem(NULL, &hmtx, 0UL, FALSE); ... } thread() { ... DosRequestMutexSem(hmtx); Locked! DosReleaseMutexSem(hmtx); ... } How would I go about doing that in Python? I figured this part out: lockobj = mutex() lockobj.lock(foo, "bar") Locked!