1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

builtin: add methods to builtin channels (#6303)

This commit is contained in:
Uwe Krüger
2020-09-05 01:36:20 +02:00
committed by GitHub
parent 246fe3bfb7
commit b015033c53
5 changed files with 93 additions and 15 deletions

20
vlib/builtin/chan.v Executable file
View File

@@ -0,0 +1,20 @@
module builtin
enum ChanState {
success
not_ready // push()/pop() would have to wait, but no_block was requested
closed
}
// The following methods are only stubs. The real implementation
// is in `vlib/sync/channels.v`
pub fn (ch chan) close() {}
pub fn (ch chan) try_pop(obj voidptr) ChanState {
return .success
}
pub fn (ch chan) try_push(obj voidptr) ChanState {
return .success
}