diff options
author | Neal H. Walfield <neal@gnu.org> | 2002-10-10 23:05:06 +0000 |
---|---|---|
committer | Neal H. Walfield <neal@gnu.org> | 2002-10-10 23:05:06 +0000 |
commit | 51c55d85632d43aa362b625ae519d00d559f9e5c (patch) | |
tree | 2efb73388ae81c46c1475bcb3133b879a0176bf1 /tests/test-12.c |
Import libpthread.
Diffstat (limited to 'tests/test-12.c')
-rw-r--r-- | tests/test-12.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/test-12.c b/tests/test-12.c new file mode 100644 index 0000000..2b78490 --- /dev/null +++ b/tests/test-12.c @@ -0,0 +1,29 @@ +/* Test concurrency level. */ + +#define _GNU_SOURCE + +#include <pthread.h> +#include <assert.h> +#include <error.h> +#include <errno.h> + +int +main (int argc, char **argv) +{ + int i; + int err; + + i = pthread_getconcurrency (); + assert (i == 0); + + err = pthread_setconcurrency (-1); + assert (err == EINVAL); + + err = pthread_setconcurrency (4); + assert (err == 0); + + i = pthread_getconcurrency (); + assert (i == 4); + + return 0; +} |