From: albert n. <nol...@gm...> - 2011-04-08 17:09:04
|
Hi, I have a question concerning the wait/notify(All) implementation in the most recent version of JikesRVM (3.1.1). 1) How can it be that the lock is zero when notifyAll in RVMThread.java is invoked? According to the JLS, the calling thread must own the lock. here is the code snippet from RVMThread,java: ... Lock l = ObjectModel.getHeavyLock(o, false); if (l == null) return; ... 2) In the function waitImpl in RVMThread.java: a) What is the purpose if the field? ... protected Object waitObject; ... It is written twice but never read. b) How can it be possible that after a thread is woken up (from the wait method) that the object on which the thread waited has no associated lock with it? I am just asking because the second parameter (see below) is set to true. ... // from wiatImpl in RVMThread.java if (waitCount != 1) { // reset recursion count Lock l2 = ObjectModel.getHeavyLock(o, true); l2.setRecursionCount(waitCount); } ... I want to make sure that I understand the wait/notify implementation in Jikes, since I am currently trying to find a bug. A thread waits on an object A, however, although calling notifyAll on the same object does not wake up the waiting thread. Many thanks for your help. Cheers, Albert |