From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <48AFE7AE.4000804@domain.hid> Date: Sat, 23 Aug 2008 12:34:22 +0200 From: Gilles Chanteperdrix MIME-Version: 1.0 References: <48AFCB3F.6070902@domain.hid> <48AFE498.2060805@domain.hid> In-Reply-To: <48AFE498.2060805@domain.hid> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Xenomai-core] Racy pse51_mutex_check_init? List-Id: "Xenomai life and development \(bug reports, patches, discussions\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Xenomai-core@domain.hid Gilles Chanteperdrix wrote: > Hi Jan, > > Please do not use my address at gmail, gna does not want me to post from > this address: > > 2008-08-23 12:10:19 1KWq4T-0000zD-9E ** xenomai@xenomai.org > R=dnslookup T=remote_smtp: SMTP error from remote mailer after RCPT TO: core@domain.hid>: host mail.gna.org [88.191.250.46]: 550 rejected because gmail.com i > s in a black list at dsn.rfc-ignorant.org > > so, here is a repost of my answer: > > Jan Kiszka wrote: >>> Hi Gilles, >>> >>> trying to understand the cb_read/write lock usage, some question came up >>> here: What prevents that the mutexq iteration in pse51_mutex_check_init >>> races against pse51_mutex_destroy_internal? > > Well, I am afraid the mechanism used is not 100% safe. Anyway, the aim > is to catch most of invalid usages, it seems we can not catch them all. No, it works, because pthread_mutex_destroy will not be able to get the write lock is the lock is read-locked. -- Gilles.