for循环能否加阻塞。不使用通道

admin87 · · 2803 次点击
更多评论
用chan会很方便实现这个功能,或者 ``` for { heap.isEmpty{ sleep(1000) } ///other code } ```
#1
``` for { if heap.isEmpty{ continue } // other } ```
#3