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!

lockobj.unlock()


Now, what (and more importantly: WHY?!) - is foo and "bar" for?

   I have written a dummyfunction for foo which does nothing when
called, but I fail to see the point of its existence. Could someone
provide an example when this would be useful?
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to