Index: ossp-pkg/pth/ChangeLog RCS File: /v/ossp/cvs/ossp-pkg/pth/ChangeLog,v rcsdiff -q -kk '-r1.542' '-r1.543' -u '/v/ossp/cvs/ossp-pkg/pth/ChangeLog,v' 2>/dev/null --- ChangeLog 2001/03/24 15:46:32 1.542 +++ ChangeLog 2001/03/24 15:55:33 1.543 @@ -21,6 +21,11 @@ Changes between 1.4a3 and 1.4a4 (29-Jul-2000 to 24-Mar-2001) + *) Implemented the pthread_{set,get}concurrency() API parts of + POSIX/SUSv2, although internally we are (allowed to be) free to not + do anything based on the requested level. + [Ralf S. Engelschall, Bill Apt ] + *) Adjusted all pthread_attr_getXXXX() functions to use a "const pthread_attr_t *" as the first argument instead of "pthread_attr_t *" to fully-conform to POSIX/SUSv2. Index: ossp-pkg/pth/pthread.c RCS File: /v/ossp/cvs/ossp-pkg/pth/pthread.c,v rcsdiff -q -kk '-r1.55' '-r1.56' -u '/v/ossp/cvs/ossp-pkg/pth/pthread.c,v' 2>/dev/null --- pthread.c 2001/03/24 15:46:32 1.55 +++ pthread.c 2001/03/24 15:55:33 1.56 @@ -384,6 +384,31 @@ } /* +** CONCURRENCY ROUTINES +** +** We just have to provide the interface, because SUSv2 says: +** "The pthread_setconcurrency() function allows an application to +** inform the threads implementation of its desired concurrency +** level, new_level. The actual level of concurrency provided by the +** implementation as a result of this function call is unspecified." +*/ + +static int pthread_concurrency = 0; + +int pthread_getconcurrency(void) +{ + return pthread_concurrency; +} + +int pthread_setconcurrency(int new_level) +{ + if (new_level < 0) + return_errno(EINVAL, EINVAL); + pthread_concurrency = new_level; + return OK; +} + +/* ** CONTEXT ROUTINES */ Index: ossp-pkg/pth/pthread.h.in RCS File: /v/ossp/cvs/ossp-pkg/pth/pthread.h.in,v rcsdiff -q -kk '-r1.58' '-r1.59' -u '/v/ossp/cvs/ossp-pkg/pth/pthread.h.in,v' 2>/dev/null --- pthread.h.in 2001/03/24 15:46:32 1.58 +++ pthread.h.in 2001/03/24 15:55:33 1.59 @@ -339,6 +339,10 @@ extern int pthread_sigmask(int, const sigset_t *, sigset_t *); extern int pthread_kill(pthread_t, int); +/* concurrency routines */ +extern int pthread_getconcurrency(void); +extern int pthread_setconcurrency(int); + /* context routines */ extern int pthread_key_create(pthread_key_t *, void (*)(void *)); extern int pthread_key_delete(pthread_key_t);