fix enum/match combo in sync_windows.v
parent
9044f1437c
commit
a9ca9f45af
|
@ -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() {
|
||||||
|
|
Loading…
Reference in New Issue