Received: from eggs.gnu.org ([140.186.70.92]:38336) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RIgZY-0000zq-Kj for qemu-devel@nongnu.org; Tue, 25 Oct 2011 08:57:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RIgNe-0004Lj-G6 for qemu-devel@nongnu.org; Tue, 25 Oct 2011 08:45:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:11122) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RIgNe-0004LT-4Z for qemu-devel@nongnu.org; Tue, 25 Oct 2011 08:45:22 -0400 From: Gerd Hoffmann Date: Tue, 25 Oct 2011 14:25:44 +0200 Message-Id: <1319545550-24203-6-git-send-email-kraxel@redhat.com> In-Reply-To: <1319545550-24203-1-git-send-email-kraxel@redhat.com> References: <1319545550-24203-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 05/11] qxl: Convert to QEMU thread API List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Jan Kiszka , Gerd Hoffmann From: Jan Kiszka Use QEMU thread API instead of pthread directly. We still need to get rid of pthread_yield, though, to drop pthread.h inclusion. Signed-off-by: Jan Kiszka Signed-off-by: Gerd Hoffmann --- hw/qxl.c | 4 ++-- hw/qxl.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/qxl.c b/hw/qxl.c index 03848ed..a0b0f36 100644 --- a/hw/qxl.c +++ b/hw/qxl.c @@ -1372,7 +1372,7 @@ static void qxl_send_events(PCIQXLDevice *d, uint32_t events) if ((old_pending & le_events) == le_events) { return; } - if (pthread_self() == d->main) { + if (qemu_thread_is_self(&d->main)) { qxl_update_irq(d); } else { if (write(d->pipe[1], d, 1) != 1) { @@ -1391,7 +1391,7 @@ static void init_pipe_signaling(PCIQXLDevice *d) fcntl(d->pipe[1], F_SETFL, O_NONBLOCK); fcntl(d->pipe[0], F_SETOWN, getpid()); - d->main = pthread_self(); + qemu_thread_get_self(&d->main); qemu_set_fd_handler(d->pipe[0], pipe_read, NULL, d); } diff --git a/hw/qxl.h b/hw/qxl.h index 868db81..37b2619 100644 --- a/hw/qxl.h +++ b/hw/qxl.h @@ -4,6 +4,7 @@ #include "hw.h" #include "pci.h" #include "vga_int.h" +#include "qemu-thread.h" #include "ui/qemu-spice.h" #include "ui/spice-display.h" @@ -63,7 +64,7 @@ typedef struct PCIQXLDevice { QemuMutex track_lock; /* thread signaling */ - pthread_t main; + QemuThread main; int pipe[2]; /* ram pci bar */ -- 1.7.1