Back to index

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

Go to the source code of this file.


int pthread_mutexattr_setrobust_np (pthread_mutexattr_t *attr, int robustness)

Function Documentation

Definition at line 25 of file pthread_mutexattr_setrobust.c.

  if (robustness != PTHREAD_MUTEX_STALLED_NP
      && __builtin_expect (robustness != PTHREAD_MUTEX_ROBUST_NP, 0))
    return EINVAL;

  struct pthread_mutexattr *iattr = (struct pthread_mutexattr *) attr;

  /* We use bit 30 to signal whether the mutex is going to be
     robust or not.  */
  if (robustness == PTHREAD_MUTEX_STALLED_NP)
    iattr->mutexkind &= ~PTHREAD_MUTEXATTR_FLAG_ROBUST;
    iattr->mutexkind |= PTHREAD_MUTEXATTR_FLAG_ROBUST;

  return 0;

Here is the caller graph for this function: