mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
sync/channels: fix bug that caused 100% CPU on block (#6357)
This commit is contained in:
@@ -110,7 +110,7 @@ pub fn new_channel<T>(n u32) &Channel {
|
||||
|
||||
fn new_channel_st(n u32, st u32) &Channel {
|
||||
return &Channel{
|
||||
writesem: new_semaphore_init(if n > 0 { n + 1 } else { 1 })
|
||||
writesem: new_semaphore_init(if n > 0 { n } else { 1 })
|
||||
readsem: new_semaphore_init(if n > 0 { u32(0) } else { 1 })
|
||||
writesem_im: new_semaphore()
|
||||
readsem_im: new_semaphore()
|
||||
|
||||
Reference in New Issue
Block a user