musl/src/thread/pthread_mutexattr_setrobust.c
Rich Felker 047e434ef5 implement robust mutexes
some of this code should be cleaned up, e.g. using macros for some of
the bit flags, masks, etc. nonetheless, the code is believed to be
working and correct at this point.
2011-03-17 20:41:37 -04:00

9 lines
171 B
C

#include "pthread_impl.h"
int pthread_mutexattr_setrobust(pthread_mutexattr_t *a, int robust)
{
if (robust > 1U) return EINVAL;
*a &= ~4;
*a |= robust*4;
return 0;
}