You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Pavel Pervov (JIRA)" <ji...@apache.org> on 2008/05/13 13:12:55 UTC

[jira] Closed: (HARMONY-5801) [drlvm][thread][regression] Thread.yield intermittently does not work.

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

Pavel Pervov closed HARMONY-5801.
---------------------------------


> [drlvm][thread][regression] Thread.yield intermittently does not work.
> ----------------------------------------------------------------------
>
>                 Key: HARMONY-5801
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5801
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: Linux
>            Reporter: Pavel Pervov
>
> The following test recently started to fail intermittently on DRLVM:
> class yield {
>     int tPass = 0;
>     class T extends Thread {
>         public void run() {
>             tPass++;
>         }
>     }
>     void test() {
>         T t = new T();
>         int numYields = 2000;
>         try {
>             t.setPriority(Thread.MAX_PRIORITY);
>             t.start();
>         } catch(Throwable e) {
>             System.out.println("Exception: " + e);
>         }
>         while(numYields > 0 && tPass == 0) {
>             numYields--;
>             Thread.currentThread().yield();
>         }
>         if(tPass == 0) {
>             System.out.println("FAILED");
>         } else {
>             System.out.println("PASSED");
>         }
>     }
>     public static void main(String[] args) {
>         new yield().test();
>     }
> }
> The test passes stably on RI.

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