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: Tue, 30 Jun 2009 10:05:12 +0200	[thread overview]
Message-ID: <4A49C738.4090705@domain.hid> (raw)
In-Reply-To: <065A7D06F7D4E546A18E80E08D066E181189FBC01D@ILMA1.IL.NDS.COM>

Landau, Bracha wrote:
> I'm using Xenomai version 2.4.

Anyway, in xenomai 2.2, mutexes were pshared by default, and there was
no way to do otherwise. After hearing critics from a well-known person
involved in the preempt_rt Linux kernel development, I implemented the
pshared attribute. So, to get mutexes the old way, you have to set the
pshared attribute. Note however, that when you use the pshared
attribute, mutexes are no longer automatically destroyed upon process
deletion.

And also note that if you simply get this problem because you call
pthread_mutex_init, then fork, then use the mutexes in the child
process, you can avoid the problem by calling pthread_mutex_init in the
child process. As explained here:

http://www.xenomai.org/index.php/Porting_POSIX_applications_to_Xenomai#Mixing_fork_with_Xenomai_POSIX_skin_services.


> 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.

Grrrmblmbl

-- 
                                          Gilles



  reply	other threads:[~2009-06-30  8:05 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 [this message]
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=4A49C738.4090705@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.