mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
checker: obey [ref_only] tag, allow embedding in other ref struct (#8707)
This commit is contained in:
@ -22,16 +22,19 @@ type SHANDLE = voidptr
|
||||
//[init_with=new_mutex] // TODO: implement support for this struct attribute, and disallow Mutex{} from outside the sync.new_mutex() function.
|
||||
|
||||
// `SRWLOCK` is much more performant that `Mutex` on Windows, so use that in both cases since we don't want to share with other processes
|
||||
[ref_only]
|
||||
pub struct Mutex {
|
||||
mut:
|
||||
mx C.SRWLOCK // mutex handle
|
||||
}
|
||||
|
||||
[ref_only]
|
||||
pub struct RwMutex {
|
||||
mut:
|
||||
mx C.SRWLOCK // mutex handle
|
||||
}
|
||||
|
||||
[ref_only]
|
||||
struct Semaphore {
|
||||
mtx C.SRWLOCK
|
||||
cond C.CONDITION_VARIABLE
|
||||
|
Reference in New Issue
Block a user