[Bug 92] threading is broken (most visible on SMP)
| Newsgroups | gmane.comp.java.vm.sablevm.bugs |
|---|---|
| Message-ID | <[email protected]> |
http://sablevm.org/bugs/show_bug.cgi?id=92 ------- Additional Comments From [email protected] 2005-01-28 23:25 ------- A comment on what I was saying about the problem in the original code. It turns out that I was looking at part of the code *I* changed: @@ -756,10 +1094,12 @@ owner->contention.owner.flag = 1; - if (_svmf_lockword_get_thinlock_id (instance->lockword) == - owner->thread.thinlock_id) + if (_svmf_lockword_is_thin (instance->lockword) && + (_svmf_lockword_get_thinlock_id (instance->lockword) + == owner->thread.thinlock_id)) { - /* the thinlock owner is still the same and has been notified */ + /* the lock is thin and thinlock owner is still the same + * and has been notified */ notified = JNI_TRUE; But the general remark still stands. The original code didn't make sure that the lockword which thinlock_id it was reading wass actually thin. OTOH my "fix" for that problem was not fully right either, because I read the lockword twice. So either way we had a problem. Reading lockword first into a temp variable, then performing the two checks on it looks like the right solution. ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. You are the QA contact for the bug, or are watching the QA contact.