mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
sync: make new_mutex() and new_waitgroup() return &Mutex and &Waitgroup
This commit is contained in:

committed by
Alexander Medvednikov

parent
bc64263dd8
commit
0d52cc97e4
@ -39,8 +39,8 @@ const (
|
||||
WAIT_FAILED = 0xFFFFFFFF
|
||||
)
|
||||
|
||||
pub fn new_mutex() Mutex {
|
||||
sm := Mutex{}
|
||||
pub fn new_mutex() &Mutex {
|
||||
sm := &Mutex{}
|
||||
unsafe {
|
||||
mut m := sm
|
||||
m.mx = C.CreateMutex(0, false, 0)
|
||||
@ -48,8 +48,8 @@ pub fn new_mutex() Mutex {
|
||||
m.state = .broken // handle broken and mutex state are broken
|
||||
return sm
|
||||
}
|
||||
return sm
|
||||
}
|
||||
return sm
|
||||
}
|
||||
|
||||
pub fn (m mut Mutex) lock() {
|
||||
|
Reference in New Issue
Block a user