[ http://issues.apache.org/jira/browse/XALANJ-2242?page=comments#action_12448480 ] Kevin Cormier commented on XALANJ-2242: ---------------------------------------
java.lang.Thread calls wait() on this in the join() method. It calls it in a loop, using isAlive() as the condition. If we signal the thread, it wakes up, checks that isAlive() still returns true, and waits again. On the other hand, since any one can join the thread, threads call notifyAll() when they exit (see ThreadGroup.remove()). So if we wait on the thread in our application, we will be signaled, but so will all of the other threads. So we don't have any ill effects on the thread system by calling wait() or notify() on the thread itself. If you can provide evidence to the contrary or point me to some documentation that says otherwise, I'd be interested to see it. > [PATCH] wait/notifying on a Thread object interferes with Thread behaviour > -------------------------------------------------------------------------- > > Key: XALANJ-2242 > URL: http://issues.apache.org/jira/browse/XALANJ-2242 > Project: XalanJ2 > Issue Type: Bug > Components: Other > Affects Versions: Latest Development Code > Reporter: Dave Brosius > Priority: Minor > Attachments: spurious_thread_states.diff > > > Calling wait or notify/notifyAll on the thread object itself, interferes with > the basic Thread management built into the jvm, causing spurious thread > states, including threads waking up when not expected, etc. > This patch fixes this -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
