Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 88856 invoked from network); 28 Feb 2007 12:10:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 28 Feb 2007 12:10:18 -0000 Received: (qmail 80781 invoked by uid 500); 28 Feb 2007 12:10:27 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 80767 invoked by uid 500); 28 Feb 2007 12:10:27 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 80757 invoked by uid 99); 28 Feb 2007 12:10:26 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Feb 2007 04:10:26 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Feb 2007 04:10:17 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 34159714042 for ; Wed, 28 Feb 2007 04:09:57 -0800 (PST) Message-ID: <23420857.1172664597210.JavaMail.jira@brutus> Date: Wed, 28 Feb 2007 04:09:57 -0800 (PST) From: "Peter Novodvorsky (JIRA)" To: commits@harmony.apache.org Subject: [jira] Updated: (HARMONY-3253) [drlvm][thread manager] Thread.join() does not ensure the TERMINATED state of a thread In-Reply-To: <1701262.1172583905718.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HARMONY-3253?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Peter Novodvorsky updated HARMONY-3253: --------------------------------------- Attachment: accurate-terminated-state.patch This patch should fix this bug. Also note, that Thread.join() doesn't use any of *_join() C functions. > [drlvm][thread manager] Thread.join() does not ensure the TERMINATED state of a thread > -------------------------------------------------------------------------------------- > > Key: HARMONY-3253 > URL: https://issues.apache.org/jira/browse/HARMONY-3253 > Project: Harmony > Issue Type: Bug > Components: DRLVM > Reporter: Elena Semukhina > Attachments: accurate-terminated-state.patch > > > The kernel test ThreadTest.testInterruptTerminated() fails intermittently with the message "interrupt status has not changed to true" when interrupting a terminated thread. This could happen when a thread exited join() but its state at that moment was not TERMINATED. > The following test shows up that the state of a thread after termination is not always TERMINATED. > public class TestGetStateJoined { > public static void main(String args[]) { > int count = 100; > for (int i = 0; i < count; i++) { > Thread t = new Thread(); > t.start(); > try { > t.join(); > } catch (InterruptedException e) { > } > Thread.State ts = t.getState(); > System.out.println("state : " + ts); > } > } > } > The test alternately prints "RUNNABLE" and "TERMINATED" on DRLVM: > > $DRLVM -showversion TestGetStateJoined > Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable. > java version "1.5.0" > pre-alpha : not complete or compatible > svn = r512139, (Feb 27 2007), Linux/ia32/gcc 3.3.3, debug build > http://incubator.apache.org/harmony > state : TERMINATED > state : RUNNABLE > state : TERMINATED > state : TERMINATED > state : TERMINATED > state : RUNNABLE > state : TERMINATED > ... > while on RI it always prints "TERMINATED": > > $RI -showversion TestGetStateJoined > java version "1.5.0_08" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_08-b03) > Java HotSpot(TM) Server VM (build 1.5.0_08-b03, mixed mode) > > state : TERMINATED > state : TERMINATED > state : TERMINATED > .... -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.