If user is seting scope process flag, clear PTHREAD_SCOPE_SYSTEM bit

accordingly.

Reviewed by: deischen
This commit is contained in:
David Xu 2003-09-14 22:32:28 +00:00
parent fba3db9f57
commit c5f1d9f6f8
2 changed files with 8 additions and 4 deletions

View File

@ -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);
}

View File

@ -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);
}