mirror of
git://git.musl-libc.org/musl
synced 2024-12-17 04:05:05 +00:00
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. :-)
This commit is contained in:
parent
11c531e21d
commit
ddd87b2f10
@ -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 <bits/pthread.h>
|
||||
|
||||
int __setjmp(void *);
|
||||
|
6
src/thread/pthread_getconcurrency.c
Normal file
6
src/thread/pthread_getconcurrency.c
Normal file
@ -0,0 +1,6 @@
|
||||
#include <pthread.h>
|
||||
|
||||
int pthread_getconcurrency()
|
||||
{
|
||||
return 0;
|
||||
}
|
9
src/thread/pthread_setconcurrency.c
Normal file
9
src/thread/pthread_setconcurrency.c
Normal file
@ -0,0 +1,9 @@
|
||||
#include <pthread.h>
|
||||
#include <errno.h>
|
||||
|
||||
int pthread_setconcurrency(int val)
|
||||
{
|
||||
if (val < 0) return EINVAL;
|
||||
if (val > 0) return EAGAIN;
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user