摘要:
package main import ( "fmt" "sync" ) type object interface{} type Set struct { m map[object]bool sync.RWMutex //线程安全实现,记录下 } //初始化 func New() *Set { return &Set{ m: map... 阅读全文
摘要:
方式一 方式二 阅读全文
摘要:
package main import ( "fmt" "math/rand" ) func main() { ch := make(chan int) done := make(chan bool) f := make(chan bool) go func() { for { select { ... 阅读全文