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:
@ -28,10 +28,12 @@ fn C.sem_timedwait(voidptr, voidptr) int
|
||||
fn C.sem_destroy(voidptr) int
|
||||
|
||||
// [init_with=new_mutex] // TODO: implement support for this struct attribute, and disallow Mutex{} from outside the sync.new_mutex() function.
|
||||
[ref_only]
|
||||
pub struct Mutex {
|
||||
mutex C.pthread_mutex_t
|
||||
}
|
||||
|
||||
[ref_only]
|
||||
pub struct RwMutex {
|
||||
mutex C.pthread_rwlock_t
|
||||
}
|
||||
@ -40,6 +42,7 @@ struct RwMutexAttr {
|
||||
attr C.pthread_rwlockattr_t
|
||||
}
|
||||
|
||||
[ref_only]
|
||||
struct Semaphore {
|
||||
sem C.sem_t
|
||||
}
|
||||
|
Reference in New Issue
Block a user