Skip to content
Snippets Groups Projects
Commit c86c915b authored by Glauber Costa's avatar Glauber Costa Committed by Pekka Enberg
Browse files

pthread: implement mutexattr functions


redis (jemalloc to be precise) actually expects that functions to succeed.
Returning -1 here means it will not initialize correctly its memory allocator.

This simple implementation just stores the desired value, but does not change
anything in the underlying mutex.

Signed-off-by: default avatarGlauber Costa <glommer@cloudius-systems.com>
Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
parent ed2a70f1
No related branches found
No related tags found
No related merge requests found
......@@ -560,26 +560,25 @@ int pthread_equal(pthread_t t1, pthread_t t2)
int pthread_mutexattr_init(pthread_mutexattr_t *attr)
{
WARN_STUBBED();
return ENOMEM;
*(attr) = PTHREAD_MUTEX_DEFAULT;
return 0;
}
int pthread_mutexattr_destroy(pthread_mutexattr_t *attr)
{
WARN_STUBBED();
return EINVAL;
return 0;
}
int pthread_mutexattr_gettype(const pthread_mutexattr_t *attr, int *type)
{
WARN_STUBBED();
return EINVAL;
*(type) = *(attr);
return 0;
}
int pthread_mutexattr_settype(pthread_mutexattr_t *attr, int type)
{
WARN_STUBBED();
return EINVAL;
*(attr) = type;
return 0;
}
int pthread_condattr_init(pthread_condattr_t *attr)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment