From: "Karl Reichert" <Karl-Trampe@domain.hid>
To: Sebastian Smolorz <smolorz@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] error creating a task with rt_task_spawn
Date: Tue, 24 Jun 2008 15:00:59 +0200 [thread overview]
Message-ID: <20080624130059.114820@domain.hid> (raw)
In-Reply-To: <4860ED80.2030400@domain.hid>
> Karl Reichert wrote:
> > Hello,
> >
> > I'm trying to create and start a new thread via rt_task_spawn() but I
> always get error -3. ("Unknown error: -3")
> >
> > Any idea?
>
> > #include "main.h"
> >
> > #include <stdio.h>
> > #include <signal.h>
> > #include <native/task.h>
> > #include <native/timer.h>
> > #include <native/mutex.h>
> > #include <sys/mman.h>
> >
> > int i,j,x;
> > RT_TASK *rx_tsk;
>
> This is a (uninitialized) pointer ...
> Maybe you wanted to type
> RT_TASK rx_tsk;
> ?
>
> >
> > int ret1;
> > int ret2;
> >
> > void rx_task(void *cookie);
> > void cleanup(int dummy);
> >
> > int main (int argc, char* argv[])
> > {
> > i = 0;
> >
> > if ( -1 == mlockall (MCL_CURRENT | MCL_FUTURE) ) {
> > perror("mlockall: ");
> > return -1;
> > }
> >
> > ret1 = rt_task_spawn(rx_tsk, "rx_task", 0, 1, T_FPU|T_CPU(1), &rx_task,
> NULL);
>
> Here you call rt_task_spawn with that pointer rx_tsk. You must provide a
> valid pointer, e.g. &rx_tsk and modify the definition of rx_tsk as above.
Yes, you are right. My fault ...
But after modifying, when I run this program, the computer locks. I can move the mouse and even mouve the windows (Xfree), but I can neither close the window, click any buttons nor enter anything in the terminal-window.
Any ideas?
Thanks
Karl
--
von Karl Reichert
next prev parent reply other threads:[~2008-06-24 13:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-24 12:36 [Xenomai-help] error creating a task with rt_task_spawn Karl Reichert
2008-06-24 12:50 ` Sebastian Smolorz
2008-06-24 13:00 ` Karl Reichert [this message]
2008-06-24 13:16 ` Sebastian Smolorz
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=20080624130059.114820@domain.hid \
--to=karl-trampe@domain.hid \
--cc=smolorz@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.