From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Wed, 21 Jun 2006 11:37:38 +0200 Message-Id: <216509776@domain.hid> MIME-Version: 1.0 From: =?iso-8859-15?Q?Tobias_B=E4r?= Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit Subject: [Xenomai-help] mutex locking List-Id: Help regarding installation and common use of Xenomai List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: xenomai@xenomai.org Hi all, my question is about the right way to lock and inquire a mutex. At time, my code looks like this: rt_mutex_inquire(&mutex,TM_NONBLOCK); if(info.lockcnt == 0) { rt_mutex_lock(&write_mutex,TM_NONBLOCK); // do sth. rt_mutex_unlock(&mutex); } What happens if anyone locks the mutex between my "rt_mutex_inquire(...)" and my "if(info.lockcnt == 0)" ? Is this the standard way to lock and inquire a mutex? Thanks, Tobias