From: Rich Felker Date: Mon, 30 May 2011 15:31:07 +0000 (-0400) Subject: implement pthread_[sg]etconcurrency. X-Git-Tag: v0.7.11~77 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=ddd87b2f10baf35ed32917bd488be8bf53ad0cc3;p=oweals%2Fmusl.git implement pthread_[sg]etconcurrency. there is a resource limit of 0 bits to store the concurrency level requested. thus any positive level exceeds a resource limit, resulting in EAGAIN. :-) --- diff --git a/include/pthread.h b/include/pthread.h index 43754ddd..5d97ebf6 100644 --- a/include/pthread.h +++ b/include/pthread.h @@ -178,6 +178,9 @@ int pthread_barrierattr_setpshared(pthread_barrierattr_t *, int); int pthread_atfork(void (*)(void), void (*)(void), void (*)(void)); +int pthread_getconcurrency(void); +int pthread_setconcurrency(int); + #include int __setjmp(void *); diff --git a/src/thread/pthread_getconcurrency.c b/src/thread/pthread_getconcurrency.c new file mode 100644 index 00000000..269429a8 --- /dev/null +++ b/src/thread/pthread_getconcurrency.c @@ -0,0 +1,6 @@ +#include + +int pthread_getconcurrency() +{ + return 0; +} diff --git a/src/thread/pthread_setconcurrency.c b/src/thread/pthread_setconcurrency.c new file mode 100644 index 00000000..091abf98 --- /dev/null +++ b/src/thread/pthread_setconcurrency.c @@ -0,0 +1,9 @@ +#include +#include + +int pthread_setconcurrency(int val) +{ + if (val < 0) return EINVAL; + if (val > 0) return EAGAIN; + return 0; +}