From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LwiKS-0007yt-Vo for qemu-devel@nongnu.org; Wed, 22 Apr 2009 15:41:57 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LwiKN-0007xR-MV for qemu-devel@nongnu.org; Wed, 22 Apr 2009 15:41:55 -0400 Received: from [199.232.76.173] (port=50617 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LwiKN-0007xL-I7 for qemu-devel@nongnu.org; Wed, 22 Apr 2009 15:41:51 -0400 Received: from mx2.redhat.com ([66.187.237.31]:53491) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LwiKL-0001eR-4P for qemu-devel@nongnu.org; Wed, 22 Apr 2009 15:41:51 -0400 Message-Id: <20090422192120.474313450@localhost.localdomain> References: <20090422191504.975476933@localhost.localdomain> Date: Wed, 22 Apr 2009 16:15:14 -0300 From: mtosatti@redhat.com Content-Disposition: inline; filename=qemu-lock Subject: [Qemu-devel] [patch 10/14] qemu: introduce lock/unlock_iothread List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, aliguori@us.ibm.com Cc: Marcelo Tosatti Hook to allow iothread to drop the global mutex. Signed-off-by: Marcelo Tosatti Index: qemu-iothread-4/vl.c =================================================================== --- qemu-iothread-4.orig/vl.c +++ qemu-iothread-4/vl.c @@ -3686,6 +3686,9 @@ static void qemu_init_main_loop(void) { } +#define qemu_mutex_lock_iothread() do { } while (0) +#define qemu_mutex_unlock_iothread() do { } while (0) + #ifdef _WIN32 static void host_main_loop_wait(int *timeout) { @@ -3778,7 +3781,9 @@ void main_loop_wait(int timeout) slirp_select_fill(&nfds, &rfds, &wfds, &xfds); } #endif + qemu_mutex_unlock_iothread(); ret = select(nfds + 1, &rfds, &wfds, &xfds, &tv); + qemu_mutex_lock_iothread(); if (ret > 0) { IOHandlerRecord **pioh; --