Add pthread_attr_setschedpolicy / pthread_attr_getschedpolicy.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@431
This commit is contained in:
Julian Seward
2002-06-17 12:19:44 +00:00
parent d8cc5306ac
commit f34cee7b2f
6 changed files with 51 additions and 6 deletions

View File

@@ -386,6 +386,21 @@ int pthread_attr_getstacksize ( const pthread_attr_t * _attr,
return 0;
}
int pthread_attr_setschedpolicy(pthread_attr_t *attr, int policy)
{
if (policy != SCHED_OTHER && policy != SCHED_FIFO && policy != SCHED_RR)
return EINVAL;
attr->__schedpolicy = policy;
return 0;
}
int pthread_attr_getschedpolicy(const pthread_attr_t *attr, int *policy)
{
*policy = attr->__schedpolicy;
return 0;
}
/* ---------------------------------------------------
Helper functions for running a thread
and for clearing up afterwards.