harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrey Pavlenko (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HARMONY-3601) [classlib][awt][drlvm][netbeans] ToolkitImpl.createImage() throws RTE: Not owner can't unlock resource
Date Thu, 26 Apr 2007 09:50:16 GMT

     [ https://issues.apache.org/jira/browse/HARMONY-3601?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Andrey Pavlenko updated HARMONY-3601:
-------------------------------------

    Attachment: HARMONY-3601.patch

Please try this patch. It does not use java.util.concurrent, Thread.interrupt() is used only
for unlocking of the event dispatch thread, all other threads are unlocked via Object.notify().
Also it performs the following performance improvements:
 - the waiting threads are not stored in the list.
 - the notify() method is used for threads unlocking instead of Thread.interrupt()
 - removes unnecessary synchronized blocks


> [classlib][awt][drlvm][netbeans] ToolkitImpl.createImage() throws RTE: Not owner can't
unlock resource
> ------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3601
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3601
>             Project: Harmony
>          Issue Type: Bug
>          Components: App-Oriented Bug Reports, Classlib, DRLVM
>            Reporter: Vasily Zakharov
>         Attachments: HARMONY-3601-Synchronizer.patch, HARMONY-3601-SynchronizerTest.patch,
HARMONY-3601.patch
>
>
> The following test calls java.awt.Toolkit.getDefaultToolkit().createImage() simultaneously
from multiple threads:
> public class Test {
>     static final int NUM_THREADS = 5;
>     static boolean success = true;
>     public static void main(String args[]) throws Exception {
>         Thread[] threads = new Thread[NUM_THREADS];
>         for (int i = 0; i < NUM_THREADS; i++) {
>             threads[i] = new Thread() {
>                 public void run() {
>                     try {
>                         java.awt.Toolkit.getDefaultToolkit().createImage(new java.net.URL("file://any/thing"));
>                     } catch (Exception e) {
>                         System.out.print("ERROR at " + Thread.currentThread() + ": ");
>                         e.printStackTrace();
>                         success = false;
>                     }
>                 }
>             };
>         }
>         for (int i = 0; i < NUM_THREADS; i++) {
>             threads[i].start();
>         }
>         for (int i = 0; i < NUM_THREADS; i++) {
>             while (true) {
>                 try {
>                     threads[i].join();
>                     break;
>                 } catch (InterruptedException e) {
>                     // Ignore.
>                 }
>             }
>         }
>         System.out.println(success ? "SUCCESS" : "FAIL");
>     }
> }
> Output on RI:
> SUCCESS
> Output on Harmony/IBM VM:
> SUCCESS:
> Output on Harmony/DRL VM (both Jit and Interpreter):
> ERROR at Thread[Thread-8,5,main]: java.lang.RuntimeException: Not owner can't unlock
resource
>         at org.apache.harmony.awt.wtk.Synchronizer.unlock(Synchronizer.java:120)
>         at java.awt.Toolkit.unlockAWT(Toolkit.java:399)
>         at java.awt.ToolkitImpl.createImage(ToolkitImpl.java:104)
>         at TestUnlock$1.run(TestUnlock.java:14)
> ERROR at Thread[Thread-7,5,main]: java.lang.RuntimeException: Not owner can't unlock
resource
>         at org.apache.harmony.awt.wtk.Synchronizer.unlock(Synchronizer.java:120)
>         at java.awt.Toolkit.unlockAWT(Toolkit.java:399)
>         at java.awt.ToolkitImpl.createImage(ToolkitImpl.java:104)
>         at TestUnlock$1.run(TestUnlock.java:14)
> ERROR at Thread[Thread-6,5,main]: java.lang.RuntimeException: Not owner can't unlock
resource
>         at org.apache.harmony.awt.wtk.Synchronizer.unlock(Synchronizer.java:120)
>         at java.awt.Toolkit.unlockAWT(Toolkit.java:399)
>         at java.awt.ToolkitImpl.createImage(ToolkitImpl.java:104)
>         at TestUnlock$1.run(TestUnlock.java:14)
> FAIL
> The problem only occurs on DRL VM, but I'm not sure whether this is a DRL VM or AWT issue,
and I have no idea how to fix it.
> The problem was discovered while trying to run Netbeans on Harmony.

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


Mime
View raw message