mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
@@ -31,7 +31,7 @@ enum Direction {
|
||||
push
|
||||
}
|
||||
|
||||
struct Channel {
|
||||
pub struct Channel {
|
||||
ringbuf &u8 // queue for buffered channels
|
||||
statusbuf &u8 // flags to synchronize write/read in ringbuf
|
||||
objsize u32
|
||||
|
@@ -54,7 +54,7 @@ MacOSX has no unnamed semaphores and no `timed_wait()` at all
|
||||
so we emulate the behaviour with other devices
|
||||
*/
|
||||
[heap]
|
||||
struct Semaphore {
|
||||
pub struct Semaphore {
|
||||
mtx C.pthread_mutex_t
|
||||
cond C.pthread_cond_t
|
||||
mut:
|
||||
|
@@ -60,7 +60,7 @@ struct RwMutexAttr {
|
||||
}
|
||||
|
||||
[heap]
|
||||
struct Semaphore {
|
||||
pub struct Semaphore {
|
||||
sem C.sem_t
|
||||
}
|
||||
|
||||
|
@@ -38,7 +38,7 @@ mut:
|
||||
}
|
||||
|
||||
[heap]
|
||||
struct Semaphore {
|
||||
pub struct Semaphore {
|
||||
mtx C.SRWLOCK
|
||||
cond C.CONDITION_VARIABLE
|
||||
mut:
|
||||
|
@@ -25,7 +25,7 @@ fn C.atomic_compare_exchange_weak_u32(voidptr, voidptr, u32) bool
|
||||
//
|
||||
// [init_with=new_waitgroup] // TODO: implement support for init_with struct attribute, and disallow WaitGroup{} from outside the sync.new_waitgroup() function.
|
||||
[heap]
|
||||
struct WaitGroup {
|
||||
pub struct WaitGroup {
|
||||
mut:
|
||||
task_count u32 // current task count - reading/writing should be atomic
|
||||
wait_count u32 // current wait count - reading/writing should be atomic
|
||||
|
Reference in New Issue
Block a user