12345678910111213141516171819202122232425262728293031323334353637383940 |
- #include <errno.h>
- #include <pthreadP.h>
- int
- pthread_mutexattr_setprotocol (
- pthread_mutexattr_t *attr,
- int protocol)
- {
- if (protocol != PTHREAD_PRIO_NONE
- && protocol != PTHREAD_PRIO_INHERIT
- && __builtin_expect (protocol != PTHREAD_PRIO_PROTECT, 0))
- return EINVAL;
- struct pthread_mutexattr *iattr = (struct pthread_mutexattr *) attr;
- iattr->mutexkind = ((iattr->mutexkind & ~PTHREAD_MUTEXATTR_PROTOCOL_MASK)
- | (protocol << PTHREAD_MUTEXATTR_PROTOCOL_SHIFT));
- return 0;
- }
|