From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <5069C2C5.5080306@xenomai.org> Date: Mon, 01 Oct 2012 18:20:21 +0200 From: Gilles Chanteperdrix MIME-Version: 1.0 References: <5069BD62.5030706@xenomai.org> <5069BF3F.1010900@xenomai.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Xenomai] Qeustion about rtdm_event_timedwait List-Id: Discussions about the Xenomai project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andrey Nechypurenko Cc: xenomai@xenomai.org 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.