* Added pthread_setconcurrency(), and pthread_getconcurrency() functions.

* Since we use a 1:1 mapping, they don't do anything besides remembering the
  level set, though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24855 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2008-04-07 10:57:01 +00:00
parent 04ea9a475f
commit b9fe86d2d7
2 changed files with 20 additions and 0 deletions

View File

@ -163,6 +163,8 @@ extern void pthread_exit(void *value_ptr);
extern int pthread_join(pthread_t thread, void **_value);
extern pthread_t pthread_self(void);
extern int pthread_kill(pthread_t thread, int sig);
extern int pthread_getconcurrency(void);
extern int pthread_setconcurrency(int newLevel);
extern int pthread_cancel(pthread_t thread);
extern int pthread_setcancelstate(int state, int *_oldState);

View File

@ -19,6 +19,7 @@ static const pthread_attr pthread_attr_default = {
static int32 sPthreadSlot = -1;
static int sConcurrencyLevel;
struct pthread_thread *
@ -157,3 +158,20 @@ pthread_detach(pthread_t thread)
return 0;
}
int
pthread_getconcurrency(void)
{
return sConcurrencyLevel;
}
int
pthread_setconcurrency(int newLevel)
{
if (newLevel < 0)
return EINVAL;
sConcurrencyLevel = newLevel;
return 0;
}