diff --git a/vlib/sync/bench/channel_bench_v.v b/vlib/sync/bench/channel_bench_v.v index 54dcfe974b..48f026989b 100644 --- a/vlib/sync/bench/channel_bench_v.v +++ b/vlib/sync/bench/channel_bench_v.v @@ -41,7 +41,9 @@ fn main() { go do_rec(ch, resch, n) no -= n } - assert no == 0 + $if debug { + assert no == 0 + } no = nobj for i in 0 .. nsend { n := no / (nsend - i) diff --git a/vlib/sync/channels.c.v b/vlib/sync/channels.c.v index 1854809fb5..ee753be39c 100644 --- a/vlib/sync/channels.c.v +++ b/vlib/sync/channels.c.v @@ -547,8 +547,10 @@ fn (mut ch Channel) try_pop_priv(dest voidptr, no_block bool) ChanState { // -2 if all channels are closed pub fn channel_select(mut channels []&Channel, dir []Direction, mut objrefs []voidptr, timeout time.Duration) int { - assert channels.len == dir.len - assert dir.len == objrefs.len + $if debug { + assert channels.len == dir.len + assert dir.len == objrefs.len + } mut subscr := []Subscription{len: channels.len} mut sem := unsafe { Semaphore{} } sem.init(0)