Loading

摘要: 顺序输出123 // 实现顺序输出123 func TestPrintNum(t *testing.T) { w := sync.WaitGroup{} a := make(chan struct{},1) b := make(chan struct{}) w.Add(2) go func() { 阅读全文
posted @ 2021-10-16 21:37 励码万言 阅读(79) 评论(0) 推荐(0) 编辑
摘要: hchan结构体 通道在运行时是一个特殊的hchan结构体,结构体内容如下: qcount 通道队列中数据个数 dataqsiz 通道队列中的数据大小 buf 存放实际数据的指针 elemsize 通道类型大小 closed 通道是否关闭 elemtype 通道类型 sendx 记录发送者在buf中 阅读全文
posted @ 2021-10-16 20:59 励码万言 阅读(85) 评论(0) 推荐(0) 编辑