From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=34767 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PncTp-00074d-Rd for qemu-devel@nongnu.org; Thu, 10 Feb 2011 14:47:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PncTm-0003XD-5K for qemu-devel@nongnu.org; Thu, 10 Feb 2011 14:47:03 -0500 Received: from moutng.kundenserver.de ([212.227.126.186]:52399) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PncTl-0003Wi-Ox for qemu-devel@nongnu.org; Thu, 10 Feb 2011 14:47:02 -0500 Message-ID: <4D5440B0.8020905@mail.berlios.de> Date: Thu, 10 Feb 2011 20:46:56 +0100 From: Stefan Weil MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 2/7] Enable I/O thread and VNC threads by default References: <4D3DFD20.8060004@linux.vnet.ibm.com> <20110125091741.GB30239@edde.se.axis.com> <20110125133453.GC5427@amt.cnet> <20110207101255.GA20413@amt.cnet> <20110207160350.GA26332@amt.cnet> <4D501C71.7090708@redhat.com> <4D50279B.5010102@siemens.com> <4D505DCB.9050406@codemonkey.ws> <20110207214551.GB16429@hall.aurel32.net> <4D50A5F0.802@codemonkey.ws> <20110208072657.GD16429@hall.aurel32.net> <4D50FA14.5010100@redhat.com> <4D5103E8.6050808@siemens.com> <4D510771.3040309@aurel32.net> <4D511221.9030505@siemens.com> <4D5113D3.9090802@aurel32.net> <4D511500.1040303@siemens.com> <4D5115C2.6060008@aurel32.net> <4D51842C.8000209@codemonkey.ws> <4D5125E2.8090902@aurel32.net> <4D5196DE.6030009@codemonkey.ws> <4D514558.9010003@aurel32.net> <4D51AD7D.6060709@codemonkey.ws> <4D515CAB.6040700@aurel32.net> <4D531235.9040004@mail.berlios.de> <4D53B5BE.5000105@redhat.com> In-Reply-To: <4D53B5BE.5000105@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Stefan Hajnoczi , Jan Kiszka , Marcelo Tosatti , "qemu-devel@nongnu.org" , Blue Swirl , Anthony Liguori , Paul Brook , Arun Bharadwaj , "Edgar E. Iglesias" , Aurelien Jarno Am 10.02.2011 10:54, schrieb Paolo Bonzini: > On 02/09/2011 11:16 PM, Stefan Weil wrote: >> The patch is available here: >> http://repo.or.cz/w/qemu/ar7.git/commitdiff/aabf11dc0a938b84d76d7c147cbf0445d7bee297 >> [snip] >> diff --git a/os-win32.c b/os-win32.c >> index b214e6a..7778366 100644 >> --- a/os-win32.c >> +++ b/os-win32.c >> @@ -36,6 +36,45 @@ >> /***********************************************************/ >> /* Functions missing in mingw */ >> >> +#if defined(CONFIG_THREAD) >> + >> +int clock_gettime(clockid_t clock_id, struct timespec *pTimespec) >> +{ >> + int result = 0; >> + if (clock_id == CLOCK_REALTIME && pTimespec != 0) { >> + DWORD t = GetTickCount(); >> + const unsigned cps = 1000; >> + struct timespec ts; >> + ts.tv_sec = t / cps; >> + ts.tv_nsec = (t % cps) * (1000000000UL / cps); >> + *pTimespec = ts; >> + } else { >> + errno = EINVAL; >> + result = -1; >> + } >> + return result; >> +} > > Why is this needed? The only user of clock_gettime in the POSIX case > is using CLOCK_MONOTONIC, and actually has a Win32 version already. qemu-thread.c uses clock_gettime(CLOCK_REALTIME, ...) > >> +int pthread_sigmask(int how, const sigset_t *set, sigset_t *oldset) >> +{ >> + /* Dummy, do nothing. */ >> + return EINVAL; >> +} >> + >> +int sigfillset(sigset_t *set) >> +{ >> + int result = 0; >> + if (set) { >> + *(set) = (sigset_t)(-1); >> + } else { >> + errno = EINVAL; >> + result = -1; >> + } >> + return result; >> +} > > Instead of these, it's better to provide a Win32 implementation of > mutexes and condvars. I'll submit it next week hopefully. > > Paolo That's good news. My patch was only a quick hack to make threaded VNC work. Thanks, Stefan