Date: Sat, 13 Jun 2009 17:34:41 +0200 From: Jilles Tjoelker <jilles@stack.nl> To: =?utf-8?B?0JzQuNGF0LDQuNC7INCa0LjQv9Cw?= <msnkipa@mail.ru> Cc: freebsd-hackers@freebsd.org Subject: Re: pthread_mutexattr_getprioceiling error? Message-ID: <20090613153441.GA35600@stack.nl> In-Reply-To: <E1MFTlI-0008Sd-00.msnkipa-mail-ru@f60.mail.ru> References: <E1MFTlI-0008Sd-00.msnkipa-mail-ru@f60.mail.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Jun 13, 2009 at 05:59:12PM +0400, Михаил Кипа wrote:
> Next little program:
> #include <pthread.h>
> #include <iostream>
> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090613153441.GA35600>
