Received: from eggs.gnu.org ([208.118.235.92]:55871) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TFp1x-0005wE-Qw for qemu-devel@nongnu.org; Sun, 23 Sep 2012 12:27:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TFp1w-0008LQ-LU for qemu-devel@nongnu.org; Sun, 23 Sep 2012 12:27:41 -0400 Received: from v220110690675601.yourvserver.net ([78.47.199.172]:59331) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TFp1w-0008LM-F4 for qemu-devel@nongnu.org; Sun, 23 Sep 2012 12:27:40 -0400 Message-ID: <3720cc81cf027c6f2a5661603b408faf.squirrel@weilnetz.de> In-Reply-To: References: <1348345579-4523-1-git-send-email-sw@weilnetz.de> Date: Sun, 23 Sep 2012 18:27:37 +0200 From: "Stefan Weil" MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] w32: Add implementation of gmtime_r, localtime_r List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: Paolo Bonzini , qemu-devel@nongnu.org > On Sat, Sep 22, 2012 at 8:26 PM, Stefan Weil wrote: >> Those functions are missing in MinGW. >> >> Some versions of MinGW-w64 include defines for gmtime_r and localtime_= r. >> Older versions of these macros are buggy (they return a pointer to a >> static variable), therefore we don't want them. Newer versions are >> similar to the code used here, but without the memset. >> >> The implementation which is used here is not strictly reentrant, >> but sufficiently good for QEMU on w32 or w64. > > For now, but nothing shows that there is a problem. Adding a few > simple locks shouldn't be difficult, or FIXME/XXX comment otherwise. > Does (or will) QEMU support preemptive scheduling of threads? If not, there is no reentrancy problem because gmtime / localtime don't trigger scheduling. Of course adding comments is always a good idea. Feel free to add one or wait until I send a v2 patch. Regards Stefan