Hello,
hopeless and nervous - we don't know any way. We havn't the periodic mode of rt
pthreads. The system crash after insmod the module. What's the difference
between other programs ?
Olaf
#ifdef __RTL__
# include <rtl_conf.h>
# ifndef RTLINUX_V2
# error "We need NMN RTLinux v2!"
# endif
#endif
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/version.h>
#include <linux/errno.h>
#ifdef RTLINUX_V2
#include <rtl.h>
#include <rtl_fifo.h>
#include <rtl_sched.h>
#include <rtl_sync.h>
#include <rtl_debug.h>
#endif
pthread_t my_pthread;
pthread_attr_t my_pthread_attr;
void* thread_code( void* par ) {
while(1)
;
return 0;
}
int create_daq_thread(void) {
int res = 0;
res += pthread_attr_init(&my_pthread_attr);
res += pthread_create(&my_pthread, &my_pthread_attr, &thread_code, (void*) 0 );
return res;
}
void remove_daq_thread(void) {
pthread_delete_np( my_pthread );
pthread_attr_destroy( &my_pthread_attr );
}
int init_module(void) {
if( create_daq_thread() != 0 )
rtl_printf("cannot create daq_thread");
return 0;
}
void cleanup_module(void) {
remove_daq_thread();
}