* [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* Re: [Xenomai-help] Problem with periodic posix thread 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 0 siblings, 1 reply; 3+ messages in thread From: Gilles Chanteperdrix @ 2011-07-11 14:13 UTC (permalink / raw) To: Kim Mathiassen; +Cc: xenomai On 07/11/2011 03:27 PM, Kim Mathiassen wrote: > 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: Do you obtain the compilation flags as explained here? http://www.xenomai.org/index.php/Porting_POSIX_applications_to_Xenomai#Compilation_flags -- Gilles. ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Xenomai-help] Problem with periodic posix thread 2011-07-11 14:13 ` Gilles Chanteperdrix @ 2011-07-12 7:25 ` Kim Mathiassen 0 siblings, 0 replies; 3+ messages in thread From: Kim Mathiassen @ 2011-07-12 7:25 UTC (permalink / raw) To: xenomai On 07/11/2011 04:13 PM, Gilles Chanteperdrix wrote: > On 07/11/2011 03:27 PM, Kim Mathiassen wrote: >> 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: > 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. ^ 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.