pthread_mutexattr_getprioceiling error?

Jilles Tjoelker jilles at stack.nl
Sat Jun 13 15:35:09 UTC 2009


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


More information about the freebsd-hackers mailing list