diff options
author | davidxu <davidxu@FreeBSD.org> | 2008-03-04 03:03:24 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2008-03-04 03:03:24 +0000 |
commit | 7046a9b03766bc2807e976ac85107f18d8727ea2 (patch) | |
tree | 9cc630a024ac946921c43bdf3224141e204e09ce /lib/libthr/thread/thr_create.c | |
parent | 23fe3bcc743fb5d390e8514b3fbfc0727047c84a (diff) | |
download | FreeBSD-src-7046a9b03766bc2807e976ac85107f18d8727ea2.zip FreeBSD-src-7046a9b03766bc2807e976ac85107f18d8727ea2.tar.gz |
implement pthread_attr_getaffinity_np and pthread_attr_setaffinity_np.
Diffstat (limited to 'lib/libthr/thread/thr_create.c')
-rw-r--r-- | lib/libthr/thread/thr_create.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/libthr/thread/thr_create.c b/lib/libthr/thread/thr_create.c index abab212..03f0584 100644 --- a/lib/libthr/thread/thr_create.c +++ b/lib/libthr/thread/thr_create.c @@ -36,6 +36,7 @@ #include <string.h> #include <stddef.h> #include <pthread.h> +#include <pthread_np.h> #include "un-namespace.h" #include "thr_private.h" @@ -73,8 +74,11 @@ _pthread_create(pthread_t * thread, const pthread_attr_t * attr, if (attr == NULL || *attr == NULL) /* Use the default thread attributes: */ new_thread->attr = _pthread_attr_default; - else + else { new_thread->attr = *(*attr); + new_thread->attr.cpuset = NULL; + new_thread->attr.cpusetsize = 0; + } if (new_thread->attr.sched_inherit == PTHREAD_INHERIT_SCHED) { /* inherit scheduling contention scope */ if (curthread->attr.flags & PTHREAD_SCOPE_SYSTEM) |