Back to index

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

Go to the source code of this file.

Functions

int pthread_rwlockattr_setkind_np (pthread_rwlockattr_t *attr, int pref)

Function Documentation

int pthread_rwlockattr_setkind_np ( pthread_rwlockattr_t *  attr,
int  pref 
)

Definition at line 25 of file pthread_rwlockattr_setkind_np.c.

{
  struct pthread_rwlockattr *iattr;

  if (pref != PTHREAD_RWLOCK_PREFER_READER_NP
      && pref != PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP
      && __builtin_expect  (pref != PTHREAD_RWLOCK_PREFER_WRITER_NP, 0))
    return EINVAL;

  iattr = (struct pthread_rwlockattr *) attr;

  iattr->lockkind = pref;

  return 0;
}