From a9ca9f45afc089381925cb5833f1da12a2ac261d Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Wed, 30 Oct 2019 17:29:05 +0300 Subject: [PATCH] fix enum/match combo in sync_windows.v --- vlib/sync/sync_windows.v | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vlib/sync/sync_windows.v b/vlib/sync/sync_windows.v index fdfe60c99c..9ed1113472 100644 --- a/vlib/sync/sync_windows.v +++ b/vlib/sync/sync_windows.v @@ -62,11 +62,17 @@ pub fn (m mut Mutex) lock() { } } state := C.WaitForSingleObject(m.mx, INFINITE) // infinite wait + /* TODO fix match/enum combo m.state = match state { WAIT_ABANDONED { .abandoned } WAIT_OBJECT_0 { .waiting } else { .broken } } + */ + mut s := MutexState.broken + if state == WAIT_ABANDONED { s = .abandoned } + else if state == WAIT_OBJECT_0 { s = .waiting } + m.state = s } pub fn (m mut Mutex) unlock() {