Add cpu affinity APIs to get and set thread's cpu affinity mask, the

functions are intented to be are compatible with glibc.
This commit is contained in:
David Xu 2008-03-03 08:28:13 +00:00
parent 223a605ac5
commit c3f43618db

View File

@ -31,6 +31,9 @@
#ifndef _PTHREAD_NP_H_
#define _PTHREAD_NP_H_
#include <sys/param.h>
#include <sys/cpuset.h>
/*
* Non-POSIX type definitions:
*/
@ -42,6 +45,9 @@ typedef void (*pthread_switch_routine_t)(pthread_t, pthread_t);
__BEGIN_DECLS
int pthread_attr_setcreatesuspend_np(pthread_attr_t *);
int pthread_attr_get_np(pthread_t, pthread_attr_t *);
int pthread_attr_getaffinity_np(const pthread_attr_t *, size_t, cpuset_t *);
int pthread_attr_setaffinity_np(pthread_attr_t *, size_t, const cpuset_t *);
int pthread_getaffinity_np(pthread_t, size_t, cpuset_t *);
int pthread_main_np(void);
int pthread_multi_np(void);
int pthread_mutexattr_getkind_np(pthread_mutexattr_t);
@ -54,6 +60,7 @@ int pthread_mutex_setspinloops_np(pthread_mutex_t *mutex, int count);
int pthread_mutex_getyieldloops_np(pthread_mutex_t *mutex, int *count);
int pthread_mutex_setyieldloops_np(pthread_mutex_t *mutex, int count);
int pthread_mutex_isowned_np(pthread_mutex_t *mutex);
int pthread_setaffinity_np(pthread_t, size_t, const cpuset_t *);
int pthread_single_np(void);
void pthread_suspend_all_np(void);
int pthread_suspend_np(pthread_t);