[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug repport
hi all
I think I have found a bug.
I think the problem is that "some" kommunikation between linux kernel
and RT-linux goes wrong.
I have made a test program. It does NOT work, and crashes -> turn off.
The program is simple. It just start a thread running every 1/10000 sec.
The thread wake up sleeping prosses up in the queue "my_queue".
The program start out fine, but when i try to open another program (in
linux user space) it crashes.
ps. I am using RT-linux 3.0 based on kernel 2.4.1
/*
* this file is have only one funktion -> to test the queue structurer
* auther : Anders Gnistrup email : agn@city.dk
*----------------------------------------------------------------------*/
#include <rtl.h>
#include <rtl_sched.h>
#include <rtl_conf.h>
#include <rtl_core.h>
#include <rtl_sync.h>
wait_queue_head_t my_queue;
pthread_t queue_ID;
void *queue(void *);
void *queue(void *t) {
while(1) {
pthread_wait_np();
wake_up(&my_queue);
}
return 0;
}
int init_module(void) {
pthread_attr_t attr;
struct sched_param sched_param;
hrtime_t period = 1000000000/11520;
init_waitqueue_head(&my_queue);
pthread_attr_init(&attr);
sched_param.sched_priority = 4;
pthread_attr_setschedparam(&attr,&sched_param);
pthread_create(&queue_ID,&attr, queue, (void *) 0);
pthread_make_periodic_np(queue_ID, gethrtime(), period);
return 0;
}
void cleanup_module(void) {
pthread_suspend_np(queue_ID);
pthread_cancel(queue_ID);
pthread_join(queue_ID, NULL);
}