Question about mutexes

Reinhold Birkenfeld reinhold-birkenfeld-nospam at wolke7.net
Wed Jun 1 12:03:30 EDT 2005


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 will want to create a threading.Lock object.

Reinhold



More information about the Python-list mailing list