From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: "Landau, Bracha" <BLandau@domain.hid>
Cc: "xenomai@xenomai.org" <xenomai@xenomai.org>
Subject: Re: [Xenomai-help] pthread_mutex_lock returns 1
Date: Tue, 30 Jun 2009 09:53:19 +0200 [thread overview]
Message-ID: <4A49C46F.8010301@domain.hid> (raw)
In-Reply-To: <065A7D06F7D4E546A18E80E08D066E181189FBBFD4@domain.hid>
Landau, Bracha wrote:
> Thanks for your help.
>
> I tried to put in "printk"s in the kernel implementation of the
> xenomai pthread_mutex_lock, and it did not work. Neither did
> xnprintf. I did this in order to find out what is the exact cause of
> the error; generally adding printk's in the kernel implementation of
> functions did work, but on this one it didn't.
>
> Is there any way to discern what exactly the problem is? This code
> was working on earlier versions of Xenomai (2.2) and did not generate
> an error on this instance of calling pthread_mutex_lock.
Either your mutex is not process-shared and you try to use it from a
different process (if that is the case, that is easy to know, you did
not call pthread_mutexattr_setpshared, and you try to access the mutex
from a different process, because you called fork after
pthread_mutex_init for instance, see
http://www.xenomai.org/index.php/Porting_POSIX_applications_to_Xenomai#Mixing_fork_with_Xenomai_POSIX_skin_services.
)
Or you are trying to lock the mutex from a thread which is not a Xenomai
thread (that is, a thread created with __real_pthread_create, or in some
part of the code where pthread_create is not wrapped with Xenomai POSIX
skin's compilation flags).
You do not tell us with what version of Xenomai you have the problem. If
this is 2.5-rc2, it is normal that you do not see your printks: the
mutexes fast path is now handled in user-space (so, now that you mention
it, I wonder if the pshared attribute works, so, you may have
pthread_mutex_lock which does not fail when it is handled in user-space,
and which fails when it has to go through kernel-space).
> This e-mail is confidential, the property of NDS Ltd and intended for
> the addressee only. Any dissemination, copying or distribution of
> this message or any attachments by anyone other than the intended
> recipient is strictly prohibited.
Please be informed that since you send this mail to a public mailing
list, we cannot fulfil these requirements in any other way than by
preventing you from posting to the list.
--
Gilles
next prev parent reply other threads:[~2009-06-30 7:53 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-29 14:22 [Xenomai-help] pthread_mutex_lock returns 1 Landau, Bracha
2009-06-29 14:32 ` Gilles Chanteperdrix
2009-06-30 7:24 ` Landau, Bracha
2009-06-30 7:53 ` Gilles Chanteperdrix [this message]
2009-06-30 7:56 ` Landau, Bracha
2009-06-30 8:05 ` Gilles Chanteperdrix
2009-06-30 8:18 ` Gilles Chanteperdrix
2009-07-01 8:31 ` Landau, Bracha
2009-07-01 8:50 ` Gilles Chanteperdrix
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=4A49C46F.8010301@domain.hid \
--to=gilles.chanteperdrix@xenomai.org \
--cc=BLandau@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.