Patch from Michael Franz (ticket #4696): sched.h and pthreads to allow setting of the thread priority

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33783 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jérôme Duval
2009-10-26 22:56:43 +00:00
parent 4c091ffef4
commit f386c5910b
4 changed files with 69 additions and 4 deletions
+2 -2
View File
@@ -229,14 +229,14 @@ extern int pthread_attr_getscope(const pthread_attr_t *attr,
int *contentionScope);
extern int pthread_attr_setscope(pthread_attr_t *attr, int contentionScope);
#if 0 /* Unimplemented attribute functions: */
/* mandatory! */
extern int pthread_attr_getschedparam(const pthread_attr_t *attr,
struct sched_param *param);
extern int pthread_attr_setschedparam(pthread_attr_t *attr,
const struct sched_param *param);
#if 0 /* Unimplemented attribute functions: */
/* [TPS] */
extern int pthread_attr_getinheritsched(const pthread_attr_t *attr,
int *inheritsched);
+11 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2008, Haiku Inc. All rights reserved.
* Copyright 2008-2009, Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT license.
*/
#ifndef _SCHED_H_
@@ -9,7 +9,17 @@
extern "C" {
#endif
#define SCHED_OTHER 1
#define SCHED_RR 2
#define SCHED_FIFO 4
struct sched_param {
int sched_priority;
};
extern int sched_yield(void);
extern int sched_get_priority_min(int);
extern int sched_get_priority_max(int);
#ifdef __cplusplus
}