From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-x734.google.com (mail-qk1-x734.google.com [IPv6:2607:f8b0:4864:20::734]) by sourceware.org (Postfix) with ESMTPS id 4FF79386F425 for ; Tue, 21 Apr 2020 22:04:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 4FF79386F425 Received: by mail-qk1-x734.google.com with SMTP id o19so410010qkk.5 for ; Tue, 21 Apr 2020 15:04:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=2XR1vtlBYqVd4mHcfbS2j519Gfl6UyxCHzqrYHs+5Ig=; b=JcH5DjTCuQRSM3k66pPNrUC0iFGkQkw89JXtOj0LJ3tWMMFHTHCBmkh/onZyeMjFoy 7UJ7A/VTu6P6XYXdS3D/ZH0WK743RGs/s72Vikecc41u2yUDOnjVyQ/fKF3TvBOINYs1 xhiASIu5Y3Fghqx2KNVEYy4cZ60tOFDGSN6aDyGYBWYH3Er/ay2dC8dCBhk0tfCYk3TJ 6/VtqEek+35nzvg0762M56WRkIB4w4maWMIaewyeghBD75hyO6iZqg6czaxL3vOIWj3f wbP2oB4NxDUCh98bJgDVPRi3KXrbNoIm0AdteAaAdVDPwx4xC640bxVMZ9TGvmpq5uTD pYDg== X-Gm-Message-State: AGi0PuYzd/DjQ440UGdJ07qYjpJ/8fWsBS5DO4UGIdm32pWwlkUmfuKh RenCinKRU26bJ2K63XjZifibFMRgPLxCvZJS/QQEA0NM X-Google-Smtp-Source: APiQypIEKCZnRLFUWNRZKDM0VUCihU7VFTzgrLiHTujXZp3WO97cs8dNzMPUNfJRHpwM16Spea4thLVBVk7VJoSWGNw= X-Received: by 2002:a37:a955:: with SMTP id s82mr24240310qke.45.1587506680938; Tue, 21 Apr 2020 15:04:40 -0700 (PDT) MIME-Version: 1.0 References: <871rogpld6.fsf@mid.deneb.enyo.de> In-Reply-To: <871rogpld6.fsf@mid.deneb.enyo.de> From: Richard Weinberger Date: Wed, 22 Apr 2020 00:04:29 +0200 Message-ID: Subject: Re: Clarification of pthread_cleanup_push() needed To: Florian Weimer Cc: Richard Weinberger via Libc-help , linux-man Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-help@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-help mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Apr 2020 22:04:42 -0000 On Tue, Apr 21, 2020 at 11:41 PM Florian Weimer wrote: > > * Richard Weinberger via Libc-help: > > > But NPTL implements thread cancellation with signals, if I'm not > > completely mistaken the cleanup routine will run in signal context > > then. > > Deferred cancellation only occurs in signal context if the > cancellation is acted upon from within a signal handler. For the > signal handler case, whether cancellation handlers are restricted to > async-signal-safe function calls depends on the type of signal (some > are synchronous, not asynchronous) and what is interrupted by the > signal (for asynchronous signals). > > Asynchronous cancellation has even more constraints than asynchronous > signal safety, but it is rarely used. I should have noted that I'm using asynchronous cancellation. Which constraints are these? -- Thanks, //richard