From patchwork Sat Nov 2 09:10:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Crowe X-Patchwork-Id: 1188311 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-106549-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=quarantine dis=none) header.from=mcrowe.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="Pb1ugsyO"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=mcrowe.com header.i=@mcrowe.com header.b="UTX51rko"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 474tbJ4rZXz9sNx for ; Sat, 2 Nov 2019 20:11:24 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; q=dns; s=default; b=t0K +A/Y6viPwKRLwG+dqsGqWzLbe178LYxvvqi7W85nI+lFzBSG3+I4Y/oa0DAOvI6c h7x2jzqxR5Pcx0nA/O9DOLUjt8P2PPizsdNzZ9xmFyBH7WiUz+3B3ykvQ3Cwf6Ci F3SKW8DgcIL/QTv2yJQWV9c/dTyKvEE2MkN/usZA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; s=default; bh=mad/+UU7O LkE/KDvPmP5lnOHr9g=; b=Pb1ugsyOvewBg5kMIx2cAohm/ESTNhUuqSK15oFQC +uPmZfOebsdxbgmSkej0lnc+1ug71g4vH7V1To8C8KET7jxslqhWtoGRwg0FVeyu +fkPZR9qce8ZlC30aRxmKIPn9RiEOpPGW2Mac4Fjl5JMhedEH0PAg69iMm8mCmXm f8= Received: (qmail 5818 invoked by alias); 2 Nov 2019 09:11:18 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 5805 invoked by uid 89); 2 Nov 2019 09:11:18 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=HContent-Transfer-Encoding:8bit X-HELO: avasout06.plus.net X-Clacks-Overhead: "GNU Terry Pratchett" X-CM-Score: 0.00 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mcrowe.com; s=20191005; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject :Cc:To:From:Sender:Reply-To:Content-Type:Content-ID:Content-Description: In-Reply-To:References; bh=zmoJW0X3xhX3hrfJoD2SgfeECRSNCJFJNaNv32oBccA=; b=UT X51rkoibCx5Z57R75lCMY9dOvUjEii+3jTEzzPYNbN8h2y7cn4/DUu5Uj1QD2x1IHN9rTFT4tBhPY 5wbAlAkFpagA0zPsfJ1vocUmV/ieqVrbLnd+JVcWhX7woloEQVNzZSYfWsCeOjjOisKIGaB7XwTHm YMaCSapJP5rdJ2f5YQ7krg9kZIpTz1FmlDnlWyL88zvAcSdxxN1LlMXe+Scp0bE5XvnE6yBNP3VVD aKIxuQ2lzK+ELZz5ozzG6uheAyUix8ZflUayReAGfR665EQYD3ik/vWQWa+MsFlVv8buE4A/3WDg8 U0zIJiANsEA0z3kGwPUbk2/zlhycfTtA==; From: Mike Crowe To: libc-alpha@sourceware.org Cc: Mike Crowe , Adhemerval Zanella , Joseph Myers , Rafal Luzynski Subject: [PATCH] nptl: Fix niggles with pthread_clockjoin_np Date: Sat, 2 Nov 2019 09:10:49 +0000 Message-Id: <1eca4bc9d946a2aa49ed380498f2d758ceb8540b.1572685738.git-series.mac@mcrowe.com> MIME-Version: 1.0 Joseph Myers spotted[1] that 69ca4b54c151cec42ccca5e05790efc1a8206b47 added pthread_clockjoin_np to sysdeps/nptl/pthread.h but not to its hppa-specific equivalent sysdeps/unix/sysv/linux/hppa/pthread.h. Rafal Luzynski spotted[2] typos in the NEWS entry and manual updates too. [1] https://sourceware.org/ml/libc-alpha/2019-11/msg00016.html [2] https://sourceware.org/ml/libc-alpha/2019-11/msg00019.html Fixes: 69ca4b54c151cec42ccca5e05790efc1a8206b47 --- NEWS | 2 +- manual/threads.texi | 2 +- sysdeps/unix/sysv/linux/hppa/pthread.h | 11 +++++++++++ 3 files changed, 13 insertions(+), 2 deletions(-) base-commit: 7aeab82edb38390c2a02519d312e098f4049e867 diff --git a/NEWS b/NEWS index 3006b1a..2fc1f89 100644 --- a/NEWS +++ b/NEWS @@ -35,7 +35,7 @@ Major new features: tz_dsttime fields are zero. * The function pthread_clockjoin_np has been added, enabling join with a - terminated thread with an specific clock. It allows waiting against + terminated thread with a specific clock. It allows waiting against CLOCK_MONOTONIC and CLOCK_REALTIME. This function is a GNU extension. Deprecated and removed features, and other changes affecting compatibility: diff --git a/manual/threads.texi b/manual/threads.texi index e40b55c..0858ef8 100644 --- a/manual/threads.texi +++ b/manual/threads.texi @@ -759,7 +759,7 @@ will wait forever in the same way as @code{pthread_join}. const struct timespec *@var{abstime}) @standards{GNU, pthread.h} @safety{@prelim{}@mtsafe{}@asunsafe{@asulock{}}@acunsafe{@aculock{}}} -Behaves like @code{pthread_timedjoin_np} except that time absolute time in +Behaves like @code{pthread_timedjoin_np} except that the absolute time in @var{abstime} is measured against the clock specified by @var{clockid}. @end deftypefun diff --git a/sysdeps/unix/sysv/linux/hppa/pthread.h b/sysdeps/unix/sysv/linux/hppa/pthread.h index 424135c..38a772a 100644 --- a/sysdeps/unix/sysv/linux/hppa/pthread.h +++ b/sysdeps/unix/sysv/linux/hppa/pthread.h @@ -238,6 +238,17 @@ extern int pthread_tryjoin_np (pthread_t __th, void **__thread_return) __THROW; __THROW. */ extern int pthread_timedjoin_np (pthread_t __th, void **__thread_return, const struct timespec *__abstime); + +/* Make calling thread wait for termination of the thread TH, but only + until TIMEOUT measured against the clock specified by CLOCKID. The + exit status of the thread is stored in *THREAD_RETURN, if + THREAD_RETURN is not NULL. + + This function is a cancellation point and therefore not marked with + __THROW. */ +extern int pthread_clockjoin_np (pthread_t __th, void **__thread_return, + clockid_t clockid, + const struct timespec *__abstime); #endif /* Indicate that the thread TH is never to be joined with PTHREAD_JOIN.