All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] Problem with periodic posix thread
@ 2011-07-11 13:27 Kim Mathiassen
  2011-07-11 14:13 ` Gilles Chanteperdrix
  0 siblings, 1 reply; 3+ messages in thread
From: Kim Mathiassen @ 2011-07-11 13:27 UTC (permalink / raw)
  To: xenomai

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-07-12  7:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-11 13:27 [Xenomai-help] Problem with periodic posix thread Kim Mathiassen
2011-07-11 14:13 ` Gilles Chanteperdrix
2011-07-12  7:25   ` Kim Mathiassen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.