1
0
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:
Delyan Angelov
2020-01-19 21:32:22 +02:00
committed by Alexander Medvednikov
parent bc64263dd8
commit 0d52cc97e4
5 changed files with 12 additions and 20 deletions

View File

@ -16,9 +16,8 @@ pub struct Mutex {
mutex C.pthread_mutex_t
}
pub fn new_mutex() Mutex {
m := Mutex{
}
pub fn new_mutex() &Mutex {
m := &Mutex{}
C.pthread_mutex_init(&m.mutex, C.NULL)
return m
}