libc: support pthread mutex type "Adaptive NP"

The initial motivation for enabling support for this pthread mutex type was
that it is required by the Glib test in genode/world.

Fixes #3817
This commit is contained in:
Martin Stein 2020-07-10 12:45:22 +02:00 committed by Norman Feske
parent 2a4adc895c
commit 66ff18a53e

View File

@ -771,9 +771,10 @@ extern "C" {
pthread_mutextype const type = (!attr || !*attr)
? PTHREAD_MUTEX_NORMAL : (*attr)->type;
switch (type) {
case PTHREAD_MUTEX_NORMAL: *mutex = new (alloc) Pthread_mutex_normal; break;
case PTHREAD_MUTEX_ERRORCHECK: *mutex = new (alloc) Pthread_mutex_errorcheck; break;
case PTHREAD_MUTEX_RECURSIVE: *mutex = new (alloc) Pthread_mutex_recursive; break;
case PTHREAD_MUTEX_NORMAL: *mutex = new (alloc) Pthread_mutex_normal; break;
case PTHREAD_MUTEX_ADAPTIVE_NP: *mutex = new (alloc) Pthread_mutex_normal; break;
case PTHREAD_MUTEX_ERRORCHECK: *mutex = new (alloc) Pthread_mutex_errorcheck; break;
case PTHREAD_MUTEX_RECURSIVE: *mutex = new (alloc) Pthread_mutex_recursive; break;
default:
*mutex = nullptr;