From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11651 invoked by alias); 5 Dec 2014 18:37:53 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 11567 invoked by uid 89); 5 Dec 2014 18:37:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.0 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Subject: [PATCH 0/3] Fix semaphore destruction (BZ #12674) From: Torvald Riegel To: GLIBC Devel Content-Type: text/plain; charset="UTF-8" Date: Fri, 05 Dec 2014 18:37:00 -0000 Message-ID: <1417804668.22797.108.camel@triegel.csb> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-12/txt/msg00155.txt.bz2 This patch set fixes https://sourceware.org/bugzilla/show_bug.cgi?id=12674 by either using 64b atomic operations (where available), or by using two separate fields when only 32b atomic operations are available. In the latter case, we keep a conservative estimate of whether there are any waiting threads in one bit of the field that counts the number of available tokens, thus allowing sem_post to atomically both add a token and determine whether it needs to call futex_wake. The first two patches are changes to the tests, the last big patch is where the actual fix resides.