From patchwork Fri Oct 4 20:01:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos O'Donell X-Patchwork-Id: 34830 Received: (qmail 67655 invoked by alias); 4 Oct 2019 20:01:47 -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 67644 invoked by uid 89); 4 Oct 2019 20:01:47 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy=act X-HELO: us-smtp-1.mimecast.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1570219304; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gwVJ2EjyPOHxgUSDizBOCEuvdab9AzwRf3gkafZx/vQ=; b=CyYKTj0hwTQxceMsbU1K6hTTGDRQCOu72yqR5UHG6eHwSYS4vSindQQLvsLFPrlgGDWoSq c1UMQeG1ufyP3R8ACW3yomEy6wzmJ1Ztfw8Xo76bbz0E5RpVR46Jorli6seRF1TSaaSDQv usq2h5exqoDEGiGugKCr5umDOx7+EDU= Return-Path: To: libc-alpha From: Carlos O'Donell Subject: [PATCH] nptl: Document AS-safe functions in cancellation.c. Message-ID: <4f3ca170-c8d2-f684-4922-a799413dddda@redhat.com> Date: Fri, 4 Oct 2019 16:01:39 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 In a recent conversation with Mathieu Desnoyer he pointed out that because write is AS-safe all the wrappers around write should be also AS-safe. We don't spell that out explicitly in the comments for __pthread_enable_asynccancel and __pthread_disable_asynccancel so I added them here. OK for master? 8< --- 8< --- 8< Document in comments that __pthread_enable_asynccancel and __pthread_disable_asynccancel must be AS-safe in general with the exception of the act of cancellation. --- ChangeLog | 5 +++++ nptl/cancellation.c | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index bdd97f0606..716f912c40 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2019-10-04 Carlos O'Donell + + * nptl/cancellation.c: Document that all functions here must be + AS-safe because they wrap AS-safe functions. + 2019-10-03 Leandro Pereira * elf/dl-load.c: Use __pread64_nocancel() instead of __lseek()+ diff --git a/nptl/cancellation.c b/nptl/cancellation.c index 7712845561..ffe5b78b18 100644 --- a/nptl/cancellation.c +++ b/nptl/cancellation.c @@ -24,7 +24,9 @@ /* The next two functions are similar to pthread_setcanceltype() but more specialized for the use in the cancelable functions like write(). - They do not need to check parameters etc. */ + They do not need to check parameters etc. This function must be + AS-safe, with the exception of the actual cancellation, because they + are called by wrappers around AS-safe functions like write().*/ int attribute_hidden __pthread_enable_asynccancel (void) @@ -59,7 +61,9 @@ __pthread_enable_asynccancel (void) return oldval; } - +/* This function must be AS-safe, with the exception of the actual + cancellation, because they are called by wrappers around AS-safe + functions like write().*/ void attribute_hidden __pthread_disable_asynccancel (int oldtype)