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: 7341 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;