mirror of
https://github.com/vlang/v.git
synced 2025-09-11 16:36:20 -04:00
vlib: use sync.new_mutex() consistently for initialising all vlib structures containing mutex fields
This commit is contained in:
parent
2643970945
commit
717076bef6
@ -145,7 +145,7 @@ mut:
|
|||||||
selection Atom // the selection atom
|
selection Atom // the selection atom
|
||||||
window Window
|
window Window
|
||||||
atoms []Atom
|
atoms []Atom
|
||||||
mutex &sync.Mutex = unsafe { nil }
|
mutex &sync.Mutex = sync.new_mutex()
|
||||||
text string // text data sent or received
|
text string // text data sent or received
|
||||||
got_text bool // used to confirm that we have got the text
|
got_text bool // used to confirm that we have got the text
|
||||||
is_owner bool // to save selection owner state
|
is_owner bool // to save selection owner state
|
||||||
|
@ -23,10 +23,10 @@ pub struct CancelContext {
|
|||||||
id string
|
id string
|
||||||
mut:
|
mut:
|
||||||
context Context
|
context Context
|
||||||
mutex &sync.Mutex
|
mutex &sync.Mutex = sync.new_mutex()
|
||||||
done chan int
|
done chan int
|
||||||
children map[string]Canceler
|
children map[string]Canceler
|
||||||
err IError
|
err IError = none
|
||||||
}
|
}
|
||||||
|
|
||||||
// with_cancel returns a copy of parent with a new done channel. The returned
|
// with_cancel returns a copy of parent with a new done channel. The returned
|
||||||
|
@ -385,8 +385,8 @@ pub fn (mut p Parser) parse() &ast.File {
|
|||||||
struct Queue {
|
struct Queue {
|
||||||
mut:
|
mut:
|
||||||
idx int
|
idx int
|
||||||
mu &sync.Mutex
|
mu &sync.Mutex = sync.new_mutex()
|
||||||
mu2 &sync.Mutex
|
mu2 &sync.Mutex = sync.new_mutex()
|
||||||
paths []string
|
paths []string
|
||||||
table &ast.Table = unsafe { nil }
|
table &ast.Table = unsafe { nil }
|
||||||
parsed_ast_files []&ast.File
|
parsed_ast_files []&ast.File
|
||||||
|
@ -448,7 +448,7 @@ fn test_fixed_array_of_function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct CTypeDefStruct {
|
struct CTypeDefStruct {
|
||||||
mutex &sync.Mutex
|
mutex &sync.Mutex = sync.new_mutex()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn test_c_struct_typedef() {
|
fn test_c_struct_typedef() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user