All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kim Mathiassen <kimmat@domain.hid>
To: xenomai@xenomai.org
Subject: [Xenomai-help] Problem with periodic posix thread
Date: Mon, 11 Jul 2011 15:27:45 +0200	[thread overview]
Message-ID: <4E1AFA51.3090209@domain.hid> (raw)

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


             reply	other threads:[~2011-07-11 13:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-11 13:27 Kim Mathiassen [this message]
2011-07-11 14:13 ` [Xenomai-help] Problem with periodic posix thread Gilles Chanteperdrix
2011-07-12  7:25   ` Kim Mathiassen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E1AFA51.3090209@domain.hid \
    --to=kimmat@domain.hid \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.