[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] win32: replace custom mutex and condition varia
Re: [Qemu-devel] [PATCH] win32: replace custom mutex and condition variable with native primitives
Mon, 3 Apr 2017 18:12:34 +0000
> From: Cornelia Huck [mailto:address@hidden
> Sent: Monday, 3 April 2017 7:20
> On Fri, 24 Mar 2017 15:01:41 -0700
> Andrew Baumann <address@hidden> wrote:
> > From: Andrey Shedel <address@hidden>
> > The multithreaded TCG implementation exposed deadlocks in the win32
> > condition variables: as implemented, qemu_cond_broadcast waited on
> > receivers, whereas the pthreads API it was intended to emulate does
> > not. This was causing a deadlock because broadcast was called while
> > holding the IO lock, as well as all possible waiters blocked on the
> > same lock.
> > This patch replaces all the custom synchronisation code for mutexes
> > and condition variables with native Windows primitives (SRWlocks and
> > condition variables) with the same semantics as their POSIX
> > equivalents. To enable that, it requires a Windows Vista or newer host
> > OS.
> > [AB: edited commit message]
> > Signed-off-by: Andrew Baumann <address@hidden>
> > ---
> > The major implication of this patch is that it drops support for
> > pre-Vista versions of Windows. However, those OSes are past their end
> > of life, and other OSS projects have dropped support. e.g.; the last
> > Cygwin release supporting XP was in Jun 2016. It doesn't seem like a
> > good tradeoff to invest effort in fixing broken code needed to support
> > them, so hopefully this isn't too controversial.
> Just a quick question:
> I noticed that this breaks builds on an old fc20-based installation I
> run some mingw cross builds on (getting an undefined reference to
> address@hidden'). I should probably take that as a
> trigger to update that installation ;), but wanted to confirm that this
> is expected.
Yes, please try updating your mingw headers. I've done x64 cross-builds from
Ubuntu 16.04 (WSL) using mingw-w64 4.0.4.