Problem with periodic posix thread
Hi
I have som problems creating a periodic posix thread. When I call pthread_make_periodic_np it returns 3 (ESRCH). I have created the following test:
void *thread()
{
while(1)
{
pthread_wait_np(NULL);
printf("Test\n"); }
}
int main()
{
pthread_t t;
pthread_create(&t, NULL, thread, NULL);
struct timespec start, period;
clock_gettime(CLOCK_REALTIME, &start);
period.tv_sec = 10;
period.tv_nsec = 0;
int error = pthread_make_periodic_np(t, &start, &period);
printf("%i\n",error);if ( error == 0 )
pthread_join(t, NULL); }
Why does it fail?
Kim Mathiassen
Quoted 5 lines · Kim Mathiassen
Hi
I have som problems creating a periodic posix thread. When I call
pthread_make_periodic_npit returns 3 (ESRCH). I have created the following test:
Do you obtain the compilation flags as explained here?
http://www.xenomai.org/index.php/Porting_POSIX_applications_to_Xenomai#Compilation_flags
Signature · 1 line
Gilles.
Quoted 10 lines · Gilles Chanteperdrix
Quoted 5 lines · Kim Mathiassen
Hi
I have som problems creating a periodic posix thread. When I call
pthread_make_periodic_npit returns 3 (ESRCH). I have created the following test:Do you obtain the compilation flags as explained here?
http://www.xenomai.org/index.php/Porting_POSIX_applications_to_Xenomai#Compilation_flags
Thanks. Now it works.