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:
@@ -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
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user