You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "weldon washburn (JIRA)" <ji...@apache.org> on 2007/05/16 05:59:16 UTC

[jira] Commented: (HARMONY-3641) [drlvm][netbeans] Thread.interrupt() throws InterruptException in wrong thread

    [ https://issues.apache.org/jira/browse/HARMONY-3641?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12496184 ] 

weldon washburn commented on HARMONY-3641:
------------------------------------------

hmm.... its not clear to me what thread checker is telling us.

However, I looked at the source code.  It seems jthread_interrupt() ultimately calls hycond_notify_all().  In other words doing a java.lang.Thread.interrupt() looks like it actually broadcasts interrupts to all the waiting threads.  This would be the wrong thing to do. Maybe its a typo.  Howver, I can not find code in svn head that can interrupt a targeted waiting thread in isolation.  That is, pull a waiting thread out of the wait queue, change the status to show it has been interrupted, then finally unblock just this one single thread.  It seems there is missing functionality (?!)  Am I misreading the source?  Does anyone else see this?

> [drlvm][netbeans] Thread.interrupt() throws InterruptException in wrong thread
> ------------------------------------------------------------------------------
>
>                 Key: HARMONY-3641
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3641
>             Project: Harmony
>          Issue Type: Bug
>          Components: App-Oriented Bug Reports, DRLVM
>            Reporter: Vasily Zakharov
>         Assigned To: weldon washburn
>         Attachments: Test.java
>
>
> Consider the attached test. It implements a simple manual synchronization mechanism using Object.wait() and Thread.interrupt(), similar to the one used by org.apache.harmony.awt.wtk.Synchronizer (see HARMONY-3601).
> On DRL VM this mechanism works incorrectly - it seems like Thread.interrupt() causes InterruptException in wrong thread or in more than one thread at once. Here's the output:
> RI:
> SUCCESS
> Harmony/IBM VM:
> SUCCESS
> Harmony/DRL VM:
> ERROR at Thread[Thread-13,5,main]: Not owner can't unlock resource
> ERROR at Thread[Thread-12,5,main]: Not owner can't unlock resource
> ERROR at Thread[Thread-11,5,main]: Not owner can't unlock resource
> ERROR at Thread[Thread-10,5,main]: Not owner can't unlock resource
> Thread[Thread-9,5,main] interrupted while working!
> Thread[Thread-8,5,main] interrupted while working!
> ERROR at Thread[Thread-8,5,main]: Not owner can't unlock resource
> Thread[Thread-7,5,main] interrupted while working!
> ERROR at Thread[Thread-7,5,main]: Not owner can't unlock resource
> Thread[Thread-6,5,main] interrupted while working!
> ERROR at Thread[Thread-6,5,main]: Not owner can't unlock resource
> ERROR at Thread[Thread-5,5,main]: Not owner can't unlock resource
> FAIL
> This issue was filed as a result of investigating the HARMONY-3601 issue with NetBeans.
> Great thanks to Andrey Pavlenko for extracting this problem out of AWT.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.