All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: marcellin <marcellin.fotze@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] another question
Date: Tue, 14 Mar 2006 12:46:22 +0100	[thread overview]
Message-ID: <4416AD0E.9040703@domain.hid> (raw)
In-Reply-To: <44169F39.2060904@domain.hid>

[-- Attachment #1: Type: text/plain, Size: 1169 bytes --]

marcellin wrote:
> Sorry, but with this tiny program i have the same error : Operation not
> permitted. What is wrong ?
> 
> ...
> int main (int argc, char **argv)
> {
> 
>  mlockall(MCL_CURRENT | MCL_FUTURE);
>    rt_timer_set_mode(TM_ONESHOT);
> 
>  err = rt_cond_create(&cond,"condition");
>  if(err != 0){
>    printf("\nrt_cond_create : %s",strerror(-err));
>  }
>  err = rt_mutex_create(&mutextest,"mut");
>  if(err != 0){
>    printf("\nrt_mutex_create : %s",strerror(-err));
>  }
> 
>  err = rt_task_create(&task,"SecondTask",0,99,0);
>  if(err != 0){
>    printf("\nrt_task_create : %s",strerror(-err));
>  }
>  err = rt_task_start(&task,&mytask,NULL);
>  if(err != 0){
>    printf("\nrt_task_start : %s",strerror(-err));
>  }
> 
> 
>  err = rt_cond_wait(&cond,&mutextest,TM_INFINITE);

You have to map your main thread to a native thread before you can
invoke a blocking RT service. Check rt_task_shadow() (and don't forget
to clean it up on exit).

>  if(err != 0){
>    printf("\nrt_cond_wait : %s",strerror(-err));
>  }
>  printf("\nend \n");
> 
>  retrurn(0);
> 
> }
> 
> regards
> 
> Marcell1
> 

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]

      reply	other threads:[~2006-03-14 11:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-14 10:47 [Xenomai-help] another question marcellin
2006-03-14 11:46 ` Jan Kiszka [this message]

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=4416AD0E.9040703@domain.hid \
    --to=jan.kiszka@domain.hid \
    --cc=marcellin.fotze@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.