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

@@ -103,7 +103,7 @@ pub struct Clipboard {
selection Atom //the selection atom
window Window
atoms []Atom
mutex sync.Mutex
mutex &sync.Mutex
text string // text data sent or received
got_text bool // used to confirm that we have got the text
is_owner bool // to save selection owner state
@@ -137,7 +137,7 @@ fn new_x11_clipboard(selection atom_type) &Clipboard {
if display == C.NULL {
println("ERROR: No X Server running. Clipboard cannot be used.")
return &Clipboard{ display: 0 }
return &Clipboard{ display: 0 mutex: sync.new_mutex() }
}
mut cb := &Clipboard{