From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29915 invoked by alias); 27 Apr 2005 11:51:42 -0000 Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Received: (qmail 29775 invoked from network); 27 Apr 2005 11:51:26 -0000 Received: from unknown (HELO TopconRD.RU) (62.105.138.7) by sourceware.org with SMTP; 27 Apr 2005 11:51:26 -0000 Received: from osv.topcon.com ([62.105.138.5]) by TopconRD.RU (8.12.3/8.12.3/Debian-6.6) with ESMTP id j3RBp7Lk019336; Wed, 27 Apr 2005 15:51:15 +0400 To: =?koi8-r?b?UnViw6luIFDDqXJleg==?= de Aranda Alonso Cc: ecos-discuss@sources.redhat.com References: <426F4C4A.4020701@sidsa.es> <877jioipv1.fsf@osv.topcon.com> <426F5990.5060105@sidsa.es> X-attribution: osv From: Sergei Organov Date: Wed, 27 Apr 2005 12:15:00 -0000 In-Reply-To: <426F5990.5060105@sidsa.es> Message-ID: <873btcigk9.fsf@osv.topcon.com> User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Common Lisp) MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 8bit Subject: Re: [ECOS] pthread_mutex_unlock when mutex is not locked X-SW-Source: 2005-04/txt/msg00277.txt.bz2 Rubén Pérez de Aranda Alonso writes: > I think the mutex is appropiate for the explained scenario. > > The standard says: "If the mutex type is PTHREAD_MUTEX_RECURSIVE, then > the mutex maintains the concept of a lock count. When a thread > successfully acquires a mutex for the first time, the lock count is > set to one. Every time a thread relocks this mutex, the lock count is > incremented by one. Each time the thread unlocks the mutex, the lock > count is decremented by one. When the lock count reaches zero, the > mutex becomes available for other threads to acquire. If a thread > attempts to unlock a mutex that it has not locked or a mutex which is > unlocked, an error will be returned." 1. Nowhere in your original post did you've mention you use POSIX mutexes. 2. Nowhere in the POSIX documents you will find anything about DSRs, so semantics of calling mutex operations from DSRs aren't defined by POSIX. -- Sergei. -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss