From c5f1d9f6f8efb51ffdf0d1cfd440b72d683364ed Mon Sep 17 00:00:00 2001 From: David Xu Date: Sun, 14 Sep 2003 22:32:28 +0000 Subject: [PATCH] If user is seting scope process flag, clear PTHREAD_SCOPE_SYSTEM bit accordingly. Reviewed by: deischen --- lib/libkse/thread/thr_attr_setscope.c | 6 ++++-- lib/libpthread/thread/thr_attr_setscope.c | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/libkse/thread/thr_attr_setscope.c b/lib/libkse/thread/thr_attr_setscope.c index 70dd69e5e6c0..dcf179e290e4 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); } diff --git a/lib/libpthread/thread/thr_attr_setscope.c b/lib/libpthread/thread/thr_attr_setscope.c index 70dd69e5e6c0..dcf179e290e4 100644 --- a/lib/libpthread/thread/thr_attr_setscope.c +++ b/lib/libpthread/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); }