From patchwork Thu Jun 25 00:07:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roland McGrath X-Patchwork-Id: 488246 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 C3373140307 for ; Thu, 25 Jun 2015 10:07:38 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=sourceware.org header.i=@sourceware.org header.b=qlwMpf+N; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:content-type :content-transfer-encoding:from:to:subject:message-id:date; q= dns; s=default; b=JYh4twbeim7ZO95p4Wu/9anHVJ141TaA4ekkp+b84xa16B 62tC7LCtRc3EeHCRcJ9IsqAMNO+JCXy7TorSEOGxRgIxj6I1SNoLJkV2wA8eExwK casKrsCBmTWKjYz6bGKfUAcgp39LsVTu6qvTwmso335tTCmWG5TI8MfPRbnqA= 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:mime-version:content-type :content-transfer-encoding:from:to:subject:message-id:date; s= default; bh=VK7PwNfNPZytKfa3k+VIxEhldF4=; b=qlwMpf+N+345wZpFVPE5 GCXZ8WYhh7YNVZ9cRKi1icqb0h3AnKDTj0KkxaFFtYpsWCvOqDJ0tT1Hs97s+RWf BoqTl5tmmW22dmT5SUCvpeW0ZOorgadxSZLZbrfovomEvFQuUwptcLRWp2I7R3CV mqnem1pkFmAuiBZxSUQWtFw= Received: (qmail 11762 invoked by alias); 25 Jun 2015 00:07:33 -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 11753 invoked by uid 89); 25 Jun 2015 00:07:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 X-HELO: topped-with-meat.com MIME-Version: 1.0 From: Roland McGrath To: "GNU C. Library" Subject: [PATCH roland/cancelhandling] NPTL: Give cancelhandling fields type unsigned int. Message-Id: <20150625000729.9C7912C3B00@topped-with-meat.com> Date: Wed, 24 Jun 2015 17:07:29 -0700 (PDT) X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=SvUDtp+0 c=1 sm=1 tr=0 a=WkljmVdYkabdwxfqvArNOQ==:117 a=14OXPxybAAAA:8 a=kj9zAlcOel0A:10 a=hOe2yjtxAAAA:8 a=Adgw1VMy7KPMWGOMV7EA:9 a=CjuIK1q_8ugA:10 This perturbed code generation for pthread_detach.c a bit more than I would have thought (on x86_64, i686, and arm), and I can't see any reason for that. But I think the semantics of the generated code are identical. The only other change to generated code is for nptl-init.c, where the compiler reversed the order of operands in a comparison instruction--but one where only eq/ne is ever tested, so it's trivially equivalent. I wouldn't mind another set of eyes on the code generation changes to verify they are indeed wholly harmless. But if nobody objects soon, I'll commit this. Thanks, Roland * nptl/descr.h (struct pthread): Change type of fields cancelhandling and parent_cancelhandling from 'int' to 'unsigned int'. diff --git a/nptl/descr.h b/nptl/descr.h index 5bd1282..818e11a 100644 --- a/nptl/descr.h +++ b/nptl/descr.h @@ -256,7 +256,7 @@ struct pthread #define HAVE_CLEANUP_JMP_BUF /* Flags determining processing of cancellation. */ - int cancelhandling; + unsigned int cancelhandling; /* Bit set if cancellation is disabled. */ #define CANCELSTATE_BIT 0 #define CANCELSTATE_BITMASK (0x01 << CANCELSTATE_BIT) @@ -322,7 +322,7 @@ struct pthread /* The parent's cancel handling at the time of the pthread_create call. This might be needed to undo the effects of a cancellation. */ - int parent_cancelhandling; + unsigned int parent_cancelhandling; /* Lock to synchronize access to the descriptor. */ int lock;