From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LkNIn-0002J5-Pq for qemu-devel@nongnu.org; Thu, 19 Mar 2009 14:49:13 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LkNIi-0002B0-LL for qemu-devel@nongnu.org; Thu, 19 Mar 2009 14:49:12 -0400 Received: from [199.232.76.173] (port=43581 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LkNIi-0002Ak-CL for qemu-devel@nongnu.org; Thu, 19 Mar 2009 14:49:08 -0400 Received: from mail2.shareable.org ([80.68.89.115]:41380) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LkNIh-0006ay-Vt for qemu-devel@nongnu.org; Thu, 19 Mar 2009 14:49:08 -0400 Received: from jamie by mail2.shareable.org with local (Exim 4.63) (envelope-from ) id 1LkNId-00022c-Pn for qemu-devel@nongnu.org; Thu, 19 Mar 2009 18:49:03 +0000 Date: Thu, 19 Mar 2009 18:49:03 +0000 From: Jamie Lokier Subject: Re: [Qemu-devel] [patch 1/7] qemu: mutex/thread/cond wrappers Message-ID: <20090319184903.GA7631@shareable.org> References: <20090319145705.988576615@localhost.localdomain> <20090319150537.801001000@localhost.localdomain> <49C26BE9.4030905@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <49C26BE9.4030905@redhat.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Avi Kivity wrote: > >+int qemu_mutex_init(QemuMutex *mutex) > >+{ > >+ return pthread_mutex_init(&mutex->lock, NULL); > >+} > > No one will check the return code, so better to check it here and > abort() if it's bad. I agree. Same applies to pthread_mutex_lock, etc., all of which return an error code, can fail if misused, and nobody checks. -- Jamie