From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58695) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmkMS-00033A-0q for qemu-devel@nongnu.org; Wed, 21 Sep 2016 12:27:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bmkMO-0000mk-Mv for qemu-devel@nongnu.org; Wed, 21 Sep 2016 12:27:03 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:44945) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmkMM-0000j9-F2 for qemu-devel@nongnu.org; Wed, 21 Sep 2016 12:27:00 -0400 Date: Wed, 21 Sep 2016 12:26:47 -0400 From: "Emilio G. Cota" Message-ID: <20160921162647.GD13385@flamenco> References: <1474289459-15242-1-git-send-email-pbonzini@redhat.com> <1474289459-15242-5-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1474289459-15242-5-git-send-email-pbonzini@redhat.com> Subject: Re: [Qemu-devel] [PATCH 04/16] linux-user: Use QemuMutex and QemuCond List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org, serge.fdrv@gmail.com, alex.bennee@linaro.org, sergey.fedorov@linaro.org On Mon, Sep 19, 2016 at 14:50:47 +0200, Paolo Bonzini wrote: > From: Sergey Fedorov > > Convert pthread_mutex_t and pthread_cond_t to QemuMutex and QemuCond. > This will allow to make some locks and conditional variables common > between user and system mode emulation. > > Signed-off-by: Sergey Fedorov > Signed-off-by: Sergey Fedorov > Reviewed-by: Alex Bennée > Signed-off-by: Alex Bennée > Message-Id: <1470158864-17651-7-git-send-email-alex.bennee@linaro.org> > Signed-off-by: Paolo Bonzini > --- > linux-user/main.c | 53 +++++++++++++++++++++++++++++++---------------------- > 1 file changed, 31 insertions(+), 22 deletions(-) > > diff --git a/linux-user/main.c b/linux-user/main.c > index 3ad70f8..0add1b0 100644 > --- a/linux-user/main.c > +++ b/linux-user/main.c > @@ -111,17 +111,25 @@ int cpu_get_pic_interrupt(CPUX86State *env) > We don't require a full sync, only that no cpus are executing guest code. > The alternative is to map target atomic ops onto host equivalents, > which requires quite a lot of per host/target work. */ > -static pthread_mutex_t cpu_list_mutex = PTHREAD_MUTEX_INITIALIZER; > -static pthread_mutex_t exclusive_lock = PTHREAD_MUTEX_INITIALIZER; Just a pet peeve of mine: this is a great opportunity to rename cpu_list_mutex to cpu_list_lock. E.