Back to index

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

Go to the source code of this file.

Functions

int pthread_mutexattr_setpshared (pthread_mutexattr_t *attr, int pshared)

Function Documentation

Definition at line 25 of file pthread_mutexattr_setpshared.c.

{
  struct pthread_mutexattr *iattr;

  if (pshared != PTHREAD_PROCESS_PRIVATE
      && __builtin_expect (pshared != PTHREAD_PROCESS_SHARED, 0))
    return EINVAL;

  iattr = (struct pthread_mutexattr *) attr;

  if (pshared == PTHREAD_PROCESS_PRIVATE)
    iattr->mutexkind &= ~PTHREAD_MUTEXATTR_FLAG_PSHARED;
  else
    iattr->mutexkind |= PTHREAD_MUTEXATTR_FLAG_PSHARED;

  return 0;
}

Here is the caller graph for this function: