thread data structure
Posted: Tue Mar 14, 2017 7:43 pm
Hi
I'm trying to implement data structure in scheduler, but when I initialize it in:
chschd.c
void _scheduler_init(void) {
ch.rlist.dl = (systime_t)50;
}
I get big number in:
thread_t *chSchReadyI(thread_t *tp) {
cp = (thread_t *)&ch.rlist.queue;
cp->dl //-> this is not 50
}
chschd.h
struct ch_thread{[/b]
systime_t dl;
}
struct ch_ready_list{
systime_t dl;
}
I thing that problem is in allocate memory but I don't find out issue.
When I try:
chschd.c
void _scheduler_init(void) {
thread_t *cp;
queue_init(&ch.rlist.queue);
ch.rlist.prio = 0;
ch.rlist.dl = (systime_t)50;
cp = (thread_t *)&ch.rlist.queue;
cp->dl -> this is 0 and not 50.
}
I'm trying to implement data structure in scheduler, but when I initialize it in:
chschd.c
void _scheduler_init(void) {
ch.rlist.dl = (systime_t)50;
}
I get big number in:
thread_t *chSchReadyI(thread_t *tp) {
cp = (thread_t *)&ch.rlist.queue;
cp->dl //-> this is not 50
}
chschd.h
struct ch_thread{[/b]
systime_t dl;
}
struct ch_ready_list{
systime_t dl;
}
I thing that problem is in allocate memory but I don't find out issue.
When I try:
chschd.c
void _scheduler_init(void) {
thread_t *cp;
queue_init(&ch.rlist.queue);
ch.rlist.prio = 0;
ch.rlist.dl = (systime_t)50;
cp = (thread_t *)&ch.rlist.queue;
cp->dl -> this is 0 and not 50.
}