source: CIVL/text/include/sched.cvl@ 09d949f

1.23 2.0 main test-branch
Last change on this file since 09d949f was 1746c5c, checked in by John Edenhofner <johneden@…>, 12 years ago

Modified header files and fixed Ticket 218

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

  • Property mode set to 100644
File size: 1.1 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 || policy == SCHED_RR)
22 {
23 return 31;
24 }
25 else
26 {
27 return 0;
28 }
29}
30
31int sched_get_priority_min(int policy){
32 return 0;
33}
34
35int sched_getparam(pid_t pid, struct sched_param *param)
36{
37 for(int i = 0; i < _pool.len-1; i++){
38 if(pid == _pool.threads[i]->thr){
39 *param = *(_pool.threads[i}->attr->param);
40 }
41 return 0;
42}
43
44int sched_setscheduler(pid_t pid, int policy, const sched_param *param)
45{
46 for(int i = 0; i < _pool.len-1; i++){
47 if(pid == _pool.threads[i]->thr){
48 *(_pool.threads[i}->attr.param) = *param;
49 *(_pool.threads[i}->attr.schedpolicy) = policy;
50 return 0;
51 }
52 }
53 return ERSCH;
54}
55
56int sched_getscheduler(pid_t pid)
57{
58 if(pid == $proc_null){
59 }
60 for(int i = 0; i < _pool.len-1; i++){
61 if(pid == _pool.threads[i]->thr){
62 return _pool.threads[i]->attr.schedpolicy;
63 }
64 }
65}
66
67*/
68
69#endif
Note: See TracBrowser for help on using the repository browser.