SetSize方法首先通過workerMut加鎖,然后根據(jù)lWorkers創(chuàng)建newWorkerWrapper,之后執(zhí)行worker.stop,再執(zhí)行worker.join(),然后清空workers Close 1 2 3 4 func (p *Pool) Close() { p.SetSize(0) close(p.reqChan) } Close方法執(zhí)行SetSize(0)及close(p.reqChan) 實例 1 2 3 4 5 6 7 8 9 10 11 12 ...
www.dbjr.com.cn/jiaoben/2921634...htm 2025-6-5