All of lore.kernel.org
 help / color / mirror / Atom feed
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: Wed, 01 Jul 2009 10:50:48 +0200	[thread overview]
Message-ID: <4A4B2368.5080108@domain.hid> (raw)
In-Reply-To: <065A7D06F7D4E546A18E80E08D066E181189FBC64C@ILMA1.IL.NDS.COM>

Landau, Bracha wrote:
>  Thanks.
> 
> The mutex failed in the function pse51_mutex_trylock_internal, in the following section (the printk is mine):
> 
> #if XENO_DEBUG(POSIX)
>         if (mutex->owningq != pse51_kqueues(mutex->attr.pshared))
>         {
>                 printk ("mutex->owningq\n");
>                 return EPERM;
>         }
> #endif /* XENO_DEBUG(POSIX) */
> 
> I have XENO_DEBUG defined.
> 
> What does this mean?

This means that the mutex you lock does not belong to the process which
tries to lock it.

A program which does:

pthread_mutex_t mutex;
pthread_mutex_init(&mutex, NULL);
pid = fork();
if (pid) {
	assert(pthread_mutex_lock(&mutex) == 0);
}

will fail for reasons I already explained (both in the two previous
answers I sent you, and in the howto I pointed you to, which also
explains how to solve this issue). I am aware that this is not the
behaviour of Linux, but changing in Xenomai is not easy.

> 
> (BTW, nothing I can do about those footers.)

Yes you can. Use a yahoo, gmail, or even a hotmail account. According to
this footer, letting your mails pass to the mailing lists would allow
your company's legal department to bother us. Because letting this mail
pass to a public mailing list is "strictly prohibited", these are the
words of the footer.

-- 
                                          Gilles



      reply	other threads:[~2009-07-01  8:50 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
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 [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=4A4B2368.5080108@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.