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

[jira] Resolved: (HARMONY-3601) [classlib][awt][drlvm][netbeans] ToolkitImpl.createImage() throws RTE: Not owner can't unlock resource

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

Alexei Zakharov resolved HARMONY-3601.
--------------------------------------

    Resolution: Fixed

Thanks Andrey and Vasya. The patch was applied at the revision 538117. I've made a little correction in test since it passed  for me on the current version of Harmony without any patching. Please verify that everything is fine. 

> [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
>         Assigned To: Alexei Zakharov
>         Attachments: HARMONY-3601-Synchronizer.patch, HARMONY-3601-SynchronizerTest.patch, HARMONY-3601.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.