Back to index

glibc  2.9
Functions
pthread_mutexattr_setprotocol.c File Reference
#include <errno.h>
#include <pthreadP.h>

Go to the source code of this file.

Functions

int pthread_mutexattr_setprotocol (pthread_mutexattr_t *attr, int protocol)

Function Documentation

Definition at line 26 of file pthread_mutexattr_setprotocol.c.

{
  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;
}

Here is the caller graph for this function: