From: "Terry Fryar" Date: Thu, 29 Dec 2011 14:39:40 -0600 Message-ID: <32A50F80EA7447F2B43C6A65BED53790@domain.hid> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0039_01CCC637.B43365F0" Subject: [Xenomai-help] Use of condition vars List-Id: Help regarding installation and common use of Xenomai List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: xenomai@xenomai.org This is a multi-part message in MIME format. ------=_NextPart_000_0039_01CCC637.B43365F0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Using Xenomai 2.6.0, I have a question regarding the use of condition variables. I think I understand why the mutex is required, but how to use it is a bit of a mystery? - To call "rt_cond_signal()", do you have to have the mutex acquired?? - I assume to call "rt_cond_wait()", you are required to have the mutex acquired, yes?? So, the pseudocode would be: Task1: . . rt_cond_signal() . . Task2, Task3, ....TaskN . . rt_mutex_acquire() while (rt_cond_wait() != 0) // got it, do code that accesses the signaled var (mutex protected) rt_mutex_release() . . . Is that it?? ------=_NextPart_000_0039_01CCC637.B43365F0 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
Using = Xenomai 2.6.0,=20 I have a question regarding the use of condition variables.  I = think I=20 understand why the mutex is required, but how to use it is a bit of a=20 mystery?
 
- To = call=20 "rt_cond_signal()", do you have to have the mutex = acquired??
 
- I = assume to call=20 "rt_cond_wait()", you are required to have the mutex acquired,=20 yes??
 
So, = the pseudocode=20 would be:
 
Task1:
.
.
rt_cond_signal()
.
.
 
Task2, = Task3,=20 ....TaskN
.
.
rt_mutex_acquire()
while=20 (rt_cond_wait() !=3D 0)
// got = it, do code=20 that accesses the signaled var (mutex protected)
rt_mutex_release()
.
.
.
 
 
Is = that=20 it??
------=_NextPart_000_0039_01CCC637.B43365F0--