summaryrefslogtreecommitdiffstats
path: root/lib/libkse
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2003-09-14 22:32:28 +0000
committerdavidxu <davidxu@FreeBSD.org>2003-09-14 22:32:28 +0000
commitb117b7ad58e82b1aa2614c11103eaf337dae0202 (patch)
tree83846d79abc00580924f7f3238800e207964dc40 /lib/libkse
parentecc9826d1b06bcd6eea61f261307f051a1fa80fa (diff)
downloadFreeBSD-src-b117b7ad58e82b1aa2614c11103eaf337dae0202.zip
FreeBSD-src-b117b7ad58e82b1aa2614c11103eaf337dae0202.tar.gz
If user is seting scope process flag, clear PTHREAD_SCOPE_SYSTEM bit
accordingly. Reviewed by: deischen
Diffstat (limited to 'lib/libkse')
-rw-r--r--lib/libkse/thread/thr_attr_setscope.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libkse/thread/thr_attr_setscope.c b/lib/libkse/thread/thr_attr_setscope.c
index 70dd69e..dcf179e 100644
--- a/lib/libkse/thread/thr_attr_setscope.c
+++ b/lib/libkse/thread/thr_attr_setscope.c
@@ -48,8 +48,10 @@ _pthread_attr_setscope(pthread_attr_t *attr, int contentionscope)
} else if ((contentionscope != PTHREAD_SCOPE_PROCESS) &&
(contentionscope != PTHREAD_SCOPE_SYSTEM)) {
ret = EINVAL;
- } else
+ } else if (contentionscope == PTHREAD_SCOPE_SYSTEM) {
(*attr)->flags |= contentionscope;
-
+ } else {
+ (*attr)->flags &= ~PTHREAD_SCOPE_SYSTEM;
+ }
return (ret);
}
OpenPOWER on IntegriCloud