A Ksem question [Was: Re: changes to thread locking layer]

Patrick Tullmann tullmann at cs.utah.edu
Mon Apr 10 15:56:42 PDT 2000


Archie Cobbs wrote:
> If it should still be true, how about adding an assert() at the
> appropriate point in the code?

I just looked into this a bit...  there's no convenient place to hang
the assert.

Currently, the locking infrastructure determines the "owner" of a lock
by checking if the magic pointer is on the current thread's stack.
(Basically we just need to know if the current thread is doing a
recursive lock --- in locks.c::slowLockMutex()).

An alternative is to put an assert in
kaffe/kaffevm/systems/unix-jthreads/jthread.c:jmutex_lock():
	assert(lock->holder != jthread_current());
We're already keeping track of ownership information here.... Actually
that code will deadlock a thread if entered it recursively.

-Pat

----- ----- ---- ---  ---  --   -    -      -         -               -
Pat Tullmann                                       tullmann at cs.utah.edu
     "VR Cows are a medium rarely well done." -- someone in c.g.a


More information about the kaffe mailing list