From owner-freebsd-hackers@FreeBSD.ORG Sat Jun 13 15:35:09 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B1551065670 for ; Sat, 13 Jun 2009 15:35:09 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id 584FB8FC18 for ; Sat, 13 Jun 2009 15:35:09 +0000 (UTC) (envelope-from jilles@stack.nl) Received: by mx1.stack.nl (Postfix, from userid 65534) id B772E359932; Sat, 13 Jun 2009 17:35:08 +0200 (CEST) X-Spam-DCC: Misty: scanner01.stack.nl 1170; Body=1 Fuz1=1 Fuz2=1 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on scanner01.stack.nl X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,NO_RELAYS autolearn=ham version=3.2.5 X-Spam-Relay-Country: _RELAYCOUNTRY_ Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 9DC39359929; Sat, 13 Jun 2009 17:35:06 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id 5EE36228CB; Sat, 13 Jun 2009 17:34:41 +0200 (CEST) Date: Sat, 13 Jun 2009 17:34:41 +0200 From: Jilles Tjoelker To: =?utf-8?B?0JzQuNGF0LDQuNC7INCa0LjQv9Cw?= Message-ID: <20090613153441.GA35600@stack.nl> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) Cc: freebsd-hackers@freebsd.org Subject: Re: pthread_mutexattr_getprioceiling error? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jun 2009 15:35:09 -0000 On Sat, Jun 13, 2009 at 05:59:12PM +0400, Михаил Кипа wrote: > Next little program: > #include > #include > int main() > { > pthread_mutexattr_t t; > if (pthread_mutexattr_init(&t)) return 1; > int i; > std::cout << pthread_mutexattr_getprioceiling(&t, &i) << std::endl; > } > always print 22. It means that pthread_mutexattr_getprioceiling always > fails with EINVAL. Under Linux this example works fine, but under > FreeBSD 7.2 it does`n work. Is it a bug in FreeBSD thread library or > it ai my misunderstanding? The priority ceiling is only meaningful with the PTHREAD_PRIO_PROTECT protocol (pthread_mutexattr_setprotocol()). The FreeBSD threads library returns EINVAL if you try to get/set the priority ceiling with another protocol. -- Jilles Tjoelker