mirror of
https://github.com/fluencelabs/musl
synced 2025-06-28 14:11:56 +00:00
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.
This commit is contained in:
9
src/thread/pthread_mutexattr_setrobust.c
Normal file
9
src/thread/pthread_mutexattr_setrobust.c
Normal file
@ -0,0 +1,9 @@
|
||||
#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;
|
||||
}
|
Reference in New Issue
Block a user