From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11820 invoked by alias); 11 Sep 2006 07:32:26 -0000 Received: (qmail 11803 invoked by uid 22791); 11 Sep 2006 07:32:25 -0000 X-Spam-Check-By: sourceware.org Received: from sunsite.ms.mff.cuni.cz (HELO sunsite.mff.cuni.cz) (195.113.15.26) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 11 Sep 2006 07:32:17 +0000 Received: from sunsite.mff.cuni.cz (sunsite.mff.cuni.cz [127.0.0.1]) by sunsite.mff.cuni.cz (8.13.1/8.13.1) with ESMTP id k8B7W7dL001802; Mon, 11 Sep 2006 09:32:07 +0200 Received: (from jj@localhost) by sunsite.mff.cuni.cz (8.13.1/8.13.1/Submit) id k8B7W7X5001798; Mon, 11 Sep 2006 09:32:07 +0200 Date: Mon, 11 Sep 2006 07:32:00 -0000 From: Jakub Jelinek To: Ulrich Drepper Cc: Glibc hackers Subject: [PATCH] Fix tst-cond22.c Message-ID: <20060911073207.GC4556@sunsite.mff.cuni.cz> Reply-To: Jakub Jelinek Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i Mailing-List: contact libc-hacker-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sourceware.org X-SW-Source: 2006-09/txt/msg00019.txt.bz2 Hi! tst-cond22.c occassionally fails with first thread not canceled cond = { 0, 2, 1, 1, 1, 0x804b140, 0, 0 } cond = { 0, 4, 2, 2, 2, 0x804b140, 0, 0 } The problem is that it relies on tf thread not being woken up (with pthread_signal) before pthread_cancel is run. If tf is woken before pthread_cancel is called in the initial thread, then the thread just runs through until return NULL; and exits. Alternatively, we could if (res == NULL) just try again a few times and only give up (with no error) if the "first thread" has not been successfully cancelled for say 16 or 32 times. 2006-09-11 Jakub Jelinek * tst-cond22.c (do_test): Don't insist the first thread has to be cancelled. --- libc/nptl/tst-cond22.c 2006-09-11 08:56:52.000000000 +0200 +++ libc/nptl/tst-cond22.c 2006-09-11 09:22:03.000000000 +0200 @@ -94,9 +94,9 @@ do_test (void) puts ("1st join failed"); return 1; } - if (res != PTHREAD_CANCELED) + if (res != PTHREAD_CANCELED && res != NULL) { - puts ("first thread not canceled"); + puts ("first thread not canceled nor exited successfully"); status = 1; } Jakub