[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Several questions
From: |
Neil Jerram |
Subject: |
Re: Several questions |
Date: |
17 Apr 2001 22:42:12 +0100 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 |
>>>>> "Ondrej" == Ondrej 'SanTiago' Zajicek <address@hidden> writes:
Ondrej> - If thread calls lock-mutex and the mutex is already
Ondrej> locked, the calling thread blocks until the mutex becomes
Ondrej> available. But IMHO classic mutex should accept more
Ondrej> locking from same thread (mutex M owned by thread T
Ondrej> shouldn't block T's calls lock-mutex M) - it's much more
Ondrej> useful. So isn't current behaviour a bug (or correct name
Ondrej> for this object should be lock and not mutex)?
It's definitely not a bug, and I believe that this is the behaviour
defined by pthreads (POSIX threads). I have no idea whether it's
classic or not :-)
Given a non-recursive mutex (as this behaviour is called), you can
easily implement a recursive mutex (which is what you want). Do you
need further help in how to do this?
Ondrej> - Is there any possibility to get thread object (object,
Ondrej> returned by call-with-new-thread) of actual thread?
I'm not sure. It looks like there isn't a way in the current code,
but I don't see why there shouldn't be, so perhaps this is a bug. Why
can't you use the object returned by call-with-new-thread, though?
Regards,
Neil