From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42893) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uv5Ix-0007Cv-Ig for qemu-devel@nongnu.org; Fri, 05 Jul 2013 08:40:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uv5Iu-0004id-F0 for qemu-devel@nongnu.org; Fri, 05 Jul 2013 08:40:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34373) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uv5Iu-0004iS-7p for qemu-devel@nongnu.org; Fri, 05 Jul 2013 08:40:00 -0400 From: Stefan Hajnoczi Date: Fri, 5 Jul 2013 14:39:43 +0200 Message-Id: <1373027986-17868-1-git-send-email-stefanha@redhat.com> Subject: [Qemu-devel] [PATCH 0/3] qemu-timer: make QEMUTimer functions thread-safe List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Anthony Liguori , Stefan Hajnoczi , alex@alex.org.uk, rth@twiddle.net This series makes the following functions thread-safe: qemu_mod_timer_ns() qemu_mod_timer() qemu_del_timer() qemu_timer_pending() The following were already thread-safe: qemu_free_timer() qemu_new_timer() qemu_timer_expired() Now it is possible to use QEMUTimer outside the QEMU global mutex. Timer callbacks are still invoked from the main loop. If a thread wishes to run timer callbacks it must use a thread-safe QEMUBH (which Ping Fan Liu is working on). Note that host_clock is not thread-safe because it keeps state and invokes reset notifiers. Device emulation threads mostly care about vm_clock, so this is not a problem. Stefan Hajnoczi (3): qemu-timer: drop outdated signal safety comments qemu-timer: add QEMUClock->active_timers list lock qemu-timer: add qemu_alarm_timer->timer_modified_lock qemu-timer.c | 129 +++++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 90 insertions(+), 39 deletions(-) -- 1.8.1.4