From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: "\"Hans Søndergaard (HSO)\"" <HSO@VIAUC.DK>
Cc: "xenomai@xenomai.org" <xenomai@xenomai.org>
Subject: Re: [Xenomai-help] rt_mutex_acquire returns -3
Date: Fri, 14 Aug 2009 10:26:19 +0200 [thread overview]
Message-ID: <4A851FAB.1060800@domain.hid> (raw)
In-Reply-To: <0AB95BFCF14F984980DE7149C21D6B90065D58B59F@FND-MAILB03.VIA.DK>
Hans Søndergaard (HSO) wrote:
> I use objects of type:
>
>
>
> typedef struct object {
>
> RT_MUTEX *rt_lock;
>
> ..
>
> } Object;
>
>
>
> int err = rt_mutex_create (ob->rt_lock, NULL);
>
> printf ("[alloc.c]: rt_mutex_create err: %d; #%d \n", err, __LINE__);
>
>
>
> err = rt_mutex_acquire (ob->rt_lock, TM_INFINITE);
>
> printf ("[lock.c]: rt_mutex_acquire, err: %d; #%d \n", err, __LINE__);
>
A question that may look stupid, is ob->rt_lock correctly initialised?
Also, why using a malloc for this, why not doing:
typedef struct object {
RT_MUTEX rt_lock;
/* ... */
} Object;
int err = rt_mutex_create (&ob->rt_lock, NULL);
err = rt_mutex_acquire (&ob->rt_lock, TM_INFINITE);
> On creation, rt_mutex_create returns 0 (as expected).
>
> On acquiring, rt_mutex_acquire returns -3,
>
> but this return value is not included among the possible return values
> in the documentation of Mutex services.
>
>
> Could you please explain what this return value -3 means?
3 is ESRCH, what version of Xenomai are you using?
--
Gilles
next prev parent reply other threads:[~2009-08-14 8:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-14 7:31 [Xenomai-help] rt_mutex_acquire returns -3 Hans Søndergaard (HSO)
2009-08-14 8:26 ` Gilles Chanteperdrix [this message]
[not found] ` <0AB95BFCF14F984980DE7149C21D6B90065D58B5EA@FND-MAILB03.VIA.DK>
2009-08-14 9:20 ` Gilles Chanteperdrix
2009-08-14 9:41 ` Philippe Gerum
2009-08-22 7:49 ` Hans Søndergaard (HSO)
2009-08-22 10:01 ` Gilles Chanteperdrix
2009-08-22 18:44 ` Hans Søndergaard (HSO)
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=4A851FAB.1060800@domain.hid \
--to=gilles.chanteperdrix@xenomai.org \
--cc=HSO@VIAUC.DK \
--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.