Initial project import
This commit is contained in:
commit
23f2d29e32
11957 files changed
+1754577
No files matched your search
@@ -0,0 +1,27 @@
|
||||
module sync
|
||||
|
||||
pub struct Channel {
|
||||
arr array
|
||||
}
|
||||
|
||||
pub fn new_channel[T](n u32) &Channel {
|
||||
return &Channel{arr, new_array()}
|
||||
}
|
||||
|
||||
pub fn (mut ch Channel) close() {}
|
||||
|
||||
pub fn (mut ch Channel) push(src voidptr) {
|
||||
#array_push(ch.val.arr,src)
|
||||
}
|
||||
|
||||
pub fn (ch Channel) len() int {
|
||||
return ch.arr.len
|
||||
}
|
||||
|
||||
pub fn (ch Channel) closed() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
pub fn (mut ch Channel) pop(dest voidptr) {
|
||||
#dest.val = array_pop(ch.val.arr)
|
||||
}
|
||||
Reference in new issue
Block a user