Skip to content
  • Andrey Shedel's avatar
    12f8def0
    win32: replace custom mutex and condition variable with native primitives · 12f8def0
    Andrey Shedel authored
    
    
    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.
    
    Signed-off-by: default avatarAndrey Shedel <ashedel@microsoft.com>
    [AB: edited commit message]
    Signed-off-by: default avatarAndrew Baumann <Andrew.Baumann@microsoft.com>
    Message-Id: <20170324220141.10104-1-Andrew.Baumann@microsoft.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    12f8def0
    win32: replace custom mutex and condition variable with native primitives
    Andrey Shedel authored
    
    
    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.
    
    Signed-off-by: default avatarAndrey Shedel <ashedel@microsoft.com>
    [AB: edited commit message]
    Signed-off-by: default avatarAndrew Baumann <Andrew.Baumann@microsoft.com>
    Message-Id: <20170324220141.10104-1-Andrew.Baumann@microsoft.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
Loading