mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
v.gen.c,v.markused: fix println(ch)
when ch is a channel
This commit is contained in:
@ -136,6 +136,10 @@ fn new_channel_st(n u32, st u32) &Channel {
|
||||
return ch
|
||||
}
|
||||
|
||||
pub fn (ch &Channel) auto_str(typename string) string {
|
||||
return 'chan $typename{cap: $ch.cap, closed: $ch.closed}'
|
||||
}
|
||||
|
||||
pub fn (mut ch Channel) close() {
|
||||
open_val := u16(0)
|
||||
if !C.atomic_compare_exchange_strong_u16(&ch.closed, &open_val, 1) {
|
||||
|
Reference in New Issue
Block a user