1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

fix enum/match combo in sync_windows.v

This commit is contained in:
Alexander Medvednikov 2019-10-30 17:29:05 +03:00
parent 9044f1437c
commit a9ca9f45af

View File

@ -62,11 +62,17 @@ pub fn (m mut Mutex) lock() {
} }
} }
state := C.WaitForSingleObject(m.mx, INFINITE) // infinite wait state := C.WaitForSingleObject(m.mx, INFINITE) // infinite wait
/* TODO fix match/enum combo
m.state = match state { m.state = match state {
WAIT_ABANDONED { .abandoned } WAIT_ABANDONED { .abandoned }
WAIT_OBJECT_0 { .waiting } WAIT_OBJECT_0 { .waiting }
else { .broken } 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() { pub fn (m mut Mutex) unlock() {