source: CIVL/text/include/sched.cvl@ 7459af4

1.23 2.0 acw/focus-triggers main test-branch
Last change on this file since 7459af4 was e1e1717, checked in by John Edenhofner <johneden@…>, 12 years ago

Added preprocessor macros as guards

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@1166 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 1.5 KB
Line 
1#ifdef __SCHED__
2#else
3#define __SCHED__
4
5#include <pthread.h>
6enum{
7 SCHED_FIFO,
8 SCHED_RR,
9 SCHED_SPORADIC,
10 SCHED_OTHER
11};
12
13typedef $proc pid_t;
14
15typedef struct{
16 int sched_priority;
17} sched_param;
18/*
19int sched_get_priority_max(int policy)
20{
21 if(policy == SCHED_FIFO)
22 {
23 for(int i = 0; i < _pool.len-1; i++){
24 if(pid == _pool.threads[i]->thr){
25 *param = *(_pool.threads[i}->attr->param);
26 }
27 }
28 }
29 else if(policy == SCHED_RR)
30 {
31 }
32 else if(policy == SCHED_SPORADIC)
33 {
34 }
35 else
36 {
37 }
38
39}
40
41int sched_get_priority_min(int policy){
42 if(policy == SCHED_FIFO)
43 {
44 for(int i = 0; i < _pool.len-1; i++){
45 if(pid == _pool.threads[i]->thr){
46 *param = *(_pool.threads[i}->attr->param);
47 }
48 }
49 }
50 else if(policy == SCHED_RR)
51 {
52 }
53 else if(policy == SCHED_SPORADIC)
54 {
55 }
56 else
57 {
58 }
59}
60
61int sched_getparam(pid_t pid, struct sched_param *param)
62{
63 for(int i = 0; i < _pool.len-1; i++){
64 if(pid == _pool.threads[i]->thr){
65 *param = *(_pool.threads[i}->attr->param);
66 }
67 return 0;
68}
69
70int sched_setscheduler(pid_t pid, int policy, const sched_param *param)
71{
72 for(int i = 0; i < _pool.len-1; i++){
73 if(pid == _pool.threads[i]->thr){
74 *(_pool.threads[i}->attr.param) = *param;
75 *(_pool.threads[i}->attr.schedpolicy) = policy;
76 return 0;
77 }
78 }
79 return ERSCH;
80}
81
82int sched_getscheduler(pid_t pid)
83{
84 if(pid == $proc_null){
85 }
86 for(int i = 0; i < _pool.len-1; i++){
87 if(pid == _pool.threads[i]->thr){
88 return _pool.threads[i]->attr.schedpolicy;
89 }
90 }
91}
92
93*/
94
95#endif
Note: See TracBrowser for help on using the repository browser.