Back to index

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

Go to the source code of this file.

Functions

int pthread_condattr_setpshared (pthread_condattr_t *attr, int pshared)

Function Documentation

Definition at line 24 of file pthread_condattr_setpshared.c.

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

  int *valuep = &((struct pthread_condattr *) attr)->value;

  *valuep = (*valuep & ~1) | (pshared != PTHREAD_PROCESS_PRIVATE);

  return 0;
}