It turned out to be caused by the mutex lock object that doesn't hold a reference to the mutex, and the lock is destructed when the mutex is refcount garbed before the call to wait(). (I still don't know what difference is causing the destruct to consistently be sufficiently delayed for me but not for Nilsson.)
Anyway, what is the reason behind the design that MutexKeys doesn't reference their Mutexes? It could potentially cause problems in more relevant cases than this, e.g. during a shutdown sequence if the object containing the mutex is gc'd while there still are several threads that is waiting to get a lock.
/ Martin Stjernholm, Roxen IS
Previous text:
2002-10-25 16:44: Subject: pike 7.3 Thread.Condition.wait and roxen.pike
In a minimized test case? I.e. this
int main() { object mutex = Thread.Mutex(); Thread.Condition()->wait(mutex->lock()); }
works while this
int main() { Thread.Condition()->wait(Thread.Mutex()->lock()); }
doesn't work for you?
/ Martin Stjernholm, Roxen IS