fix enum/match combo in sync_windows.v

pull/2592/head
Alexander Medvednikov 2019-10-30 17:29:05 +03:00
parent 9044f1437c
commit a9ca9f45af
1 changed files with 6 additions and 0 deletions

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() {