From owner-freebsd-stable@FreeBSD.ORG Tue Nov 24 15:47:47 2009 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6DD021065695 for ; Tue, 24 Nov 2009 15:47:47 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-bw0-f213.google.com (mail-bw0-f213.google.com [209.85.218.213]) by mx1.freebsd.org (Postfix) with ESMTP id ED0F78FC20 for ; Tue, 24 Nov 2009 15:47:46 +0000 (UTC) Received: by bwz5 with SMTP id 5so6520691bwz.3 for ; Tue, 24 Nov 2009 07:47:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:to:cc:subject:references :organization:from:date:in-reply-to:message-id:user-agent :mime-version:content-type; bh=YBuNJXGraUfaw1TMHhGoUNjVqli5F/rDlZMAfXrqNdA=; b=aWRNI1piKE4lUBb36viaxZ9O2EktPPbVrghnnrSDrgyjFP5bnSsTfaEdHTYZGY1+Ad BZWrH/zHbIlXTlxEuXFugPhnGhx8U/yrP+LnXqqig1t7sARzmc+My1df+r9J9mAn3Uap dxfvqJuhHa92ounzR0XLCy6RJ6yYpPvck/LHY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=to:cc:subject:references:organization:from:date:in-reply-to :message-id:user-agent:mime-version:content-type; b=by5KBg3w7LMG2eTH+Fgc2w3h/qoJuLX4PUvv/74jBMiuSu61Z1r604rG/X3ti0gXJn fWX7O29GBiX2d37xF0XJVgVFtto5Ki6EU3YbWuQAzmbuBTsNCLjB+NWlkqD2Qqf08HqA ed9XZB5dEh7iy82+Y5TIbUAlw1iG5HrWXfUqI= Received: by 10.204.156.217 with SMTP id y25mr990263bkw.76.1259077665636; Tue, 24 Nov 2009 07:47:45 -0800 (PST) Received: from localhost (ms.singlescrowd.net [80.85.90.67]) by mx.google.com with ESMTPS id 15sm1434571bwz.4.2009.11.24.07.47.44 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 24 Nov 2009 07:47:44 -0800 (PST) To: Kostik Belousov References: <86aayc7z4g.fsf@zhuzha.ua1> <8663907xyy.fsf@zhuzha.ua1> <20091124153422.GT2331@deviant.kiev.zoral.com.ua> Organization: TOA Ukraine From: Mikolaj Golub Date: Tue, 24 Nov 2009 17:47:42 +0200 In-Reply-To: <20091124153422.GT2331@deviant.kiev.zoral.com.ua> (Kostik Belousov's message of "Tue\, 24 Nov 2009 17\:34\:22 +0200") Message-ID: <861vjn9b6p.fsf@zhuzha.ua1> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: FreeBSD Stable Subject: Re: pthread.h: typo in #define pthread_cleanup_push/pthread_cleanup_pop X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2009 15:47:47 -0000 On Tue, 24 Nov 2009 17:34:22 +0200 Kostik Belousov wrote: > pthread_cleanup_push/pop are supposed to be used from the common > lexical scope. Citation from SUSv4: > > These functions may be implemented as macros. The application shall > ensure that they appear as statements, and in pairs within the same > lexical scope (that is, the pthread_cleanup_push() macro may be > thought to expand to a token list whose first token is '{' with > pthread_cleanup_pop() expanding to a token list whose last token is the > corresponding '}' ). > > Your change is wrong. > > Basically, the code should do > pthread_cleanup_push(some_func, arh); > something ... > pthread_cleanup_pop(1); > (1 denotes that some_func should be called). I see. Thank you. So it really looks like a bug in our application as pthread_cleanup_pop(1) is missed. I will tell our developers :-) -- Mikolaj Golub