All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Andrey Nechypurenko <andreynech@googlemail.com>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai] Qeustion about rtdm_event_timedwait
Date: Mon, 01 Oct 2012 18:20:21 +0200	[thread overview]
Message-ID: <5069C2C5.5080306@xenomai.org> (raw)
In-Reply-To: <CAOiXNkCF950997tST8T4VJQHxTT=2eh+GwcwRPsgfmZu3oq=Rw@mail.gmail.com>

On 10/01/2012 06:13 PM, Andrey Nechypurenko wrote:
>>> Also note that rtdm_event_wait works like a semaphore, not like a
>>> condition variable: it has a counter, rtdm_event_wait will return
>>> immediately as many times as rtdm_event_signal was called.
> 
> In this case event_pulse will be then the closest match to condition
> variable. Right?

Well, looking at the code, it is not right, rtdm_event_wait works like a
semaphore, but a binary semaphore. So, if rtdm_event_signal was called
before rtdm_event_wait, rtdm_event_wait will return immediately, but if
it was called several times, rtdm_event_wait will return immediately
only once.

rtdm_event_pulse unlocks all threads currently blocked in
rtdm_event_wait, but you are right, it works more like a condvar.

-- 
					    Gilles.


      reply	other threads:[~2012-10-01 16:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-01 15:51 [Xenomai] Qeustion about rtdm_event_timedwait Andrey Nechypurenko
2012-10-01 15:57 ` Gilles Chanteperdrix
2012-10-01 16:01   ` Andrey Nechypurenko
2012-10-01 16:05     ` Gilles Chanteperdrix
2012-10-01 16:10       ` Andrey Nechypurenko
2012-10-01 16:13         ` Andrey Nechypurenko
2012-10-01 16:20           ` 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=5069C2C5.5080306@xenomai.org \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=andreynech@googlemail.com \
    --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.