blob: f8db97db89812e00d2d3b126822093faa75a2650 [file]
id,url,icon_url,issue_key,title,description,epic_key,type,status,original_status,story_point,resolution_date,created_date,updated_date,lead_time_minutes,parent_issue_id,priority,original_estimate_minutes,time_spent_minutes,time_remaining_minutes,creator_id,creator_name,assignee_id,assignee_name,severity,component,_raw_data_params,_raw_data_table,_raw_data_id,_raw_data_remark
github:GithubIssue:1:346842831,https://github.com/panjf2000/ants/issues/5,,5,关于 <-p.freeSignal 的疑惑,"""Hi,\r\n 我阅读了源码,对 `<-p.freeSignal` 这句代码有疑惑。 这句代码出现在了多个地方,freeSignal 的作用英文注释我是理解的,并且知道在 `putWorker` 中才进行 `p.freeSignal <- sig{}`\r\n\r\n对于下面的代码\r\n```\r\nfunc (p *Pool) getWorker() *Worker {\r\n\tvar w *Worker\r\n\twaiting := false\r\n\r\n\tp.lock.Lock()\r\n\tidleWorkers := p.workers\r\n\tn := len(idleWorkers) - 1\r\n\tif n < 0 { // 说明 pool中没有worker了\r\n\t\twaiting = p.Running() >= p.Cap()\r\n\t} else { // 说明pool中有worker\r\n\t\t<-p.freeSignal \r\n\t\tw = idleWorkers[n] \r\n\t\tidleWorkers[n] = nil\r\n\t\tp.workers = idleWorkers[:n]\r\n\t}\r\n\tp.lock.Unlock()\r\n\r\n\r\nfunc (p *Pool) Release() error {\r\n\tp.once.Do(func() { // 保证只释放一次\r\n\t\tp.release <- sig{}\r\n\t\tp.lock.Lock()\r\n\t\tidleWorkers := p.workers\r\n\t\tfor i, w := range idleWorkers {\r\n\t\t\t<-p.freeSignal\r\n\t\t\tw.task <- nil\r\n\t\t\tidleWorkers[i] = nil\r\n\t\t}\r\n\t\tp.workers = nil\r\n\t\tp.lock.Unlock()\r\n\t})\r\n\treturn nil\r\n}\r\n\r\n```\r\n\r\n中的 `<-p.freeSignal`, 那不是要等putWorker触发了才会继续进行吗?如果 putWorker不触发,就一直阻塞在那了,即使 idleWorkers 中可能是有worker的\r\n\r\n可否解释下这边的逻辑?谢谢""",,,DONE,closed,0,2018-08-03T15:32:00.000+00:00,2018-08-02T03:09:57.000+00:00,2018-08-10T04:06:36.000+00:00,2182,,,0,0,0,github:GithubAccount:1:8605102,pathbox,github:GithubAccount:1:0,,,,"{""ConnectionId"":1,""Name"":""panjf2000/ants""}",_raw_github_api_issues,11,
github:GithubIssue:1:347255859,https://github.com/panjf2000/ants/issues/6,,6,死锁bug,"""func (p *Pool) getWorker() *Worker 这个函数的 199行 \r\n必须先解锁在加锁, 要不然会产生死锁\r\n\r\n\tp.lock.Unlock()\r\n\t\t<-p.freeSignal\r\n\t\tp.lock.Lock()""",,BUG,DONE,closed,0,2018-08-04T10:18:41.000+00:00,2018-08-03T04:32:28.000+00:00,2018-08-04T10:18:41.000+00:00,1786,,,0,0,0,github:GithubAccount:1:13118848,lovelly,github:GithubAccount:1:0,,,,"{""ConnectionId"":1,""Name"":""panjf2000/ants""}",_raw_github_api_issues,12,
github:GithubIssue:1:348630179,https://github.com/panjf2000/ants/issues/7,,7,清理过期协程报错,"""你好,非常感谢提供这么好用的工具包。我在使用ants时,发现报异常。结果见下图\r\n![image](https://user-images.githubusercontent.com/4555057/43823431-98384444-9b21-11e8-880c-7458b931734a.png)\r\n日志是我在periodicallyPurge里加的调试信息\r\n![image](https://user-images.githubusercontent.com/4555057/43823534-e3c624a8-9b21-11e8-96c6-512e3e08db22.png)\r\n\r\n### 原因分析\r\n\r\n我认为可能原因是没有处理n==0的情况\r\n```\r\nif n > 0 {\r\n\tn++\r\n\tp.workers = idleWorkers[n:]\r\n}\r\n```\r\n\r\n\r\n### 测试代码\r\n```\r\npackage main\r\n\r\nimport (\r\n\t\""github.com/panjf2000/ants\""\r\n\t\""fmt\""\r\n\t\""time\""\r\n\t\""strconv\""\r\n)\r\n\r\nfunc main() {\r\n\r\n\tpool,err := ants.NewPool(100000)\r\n\r\n\tif err != nil {\r\n\t\tpanic(err)\r\n\t}\r\n\r\n\tfor i:=0;i<10000;i++{\r\n\t\tpool.Submit(\r\n\t\t\tfunc() error {\r\n\t\t\t\ttime.Sleep(1 * time.Millisecond)\r\n\t\t\t\tfmt.Println(strconv.Itoa(i))\r\n\t\t\t\treturn nil\r\n\t\t\t})\r\n\t}\r\n\r\n\tfor{\r\n\t\tpool.Submit(\r\n\t\t\tfunc() error {\r\n\t\t\t\ttime.Sleep(10 * time.Millisecond)\r\n\t\t\treturn nil\r\n\t\t})\r\n\t\ttime.Sleep(1 * time.Millisecond)\r\n\t}\r\n}\r\n```""",,BUG,DONE,closed,0,2018-08-10T04:06:04.000+00:00,2018-08-08T08:43:15.000+00:00,2018-08-10T04:06:04.000+00:00,2602,,,0,0,0,github:GithubAccount:1:4555057,huiwq1990,github:GithubAccount:1:0,,,,"{""ConnectionId"":1,""Name"":""panjf2000/ants""}",_raw_github_api_issues,13,
github:GithubIssue:1:356703393,https://github.com/panjf2000/ants/issues/10,,10,高并发下设定较小的worker数量问题,"""会存在cpu飚升的问题吧?""",,,DONE,closed,0,2018-09-29T11:45:00.000+00:00,2018-09-04T08:26:55.000+00:00,2018-09-29T11:45:00.000+00:00,36198,,,0,0,0,github:GithubAccount:1:11763614,Moonlight-Zhao,github:GithubAccount:1:0,,,,"{""ConnectionId"":1,""Name"":""panjf2000/ants""}",_raw_github_api_issues,16,
github:GithubIssue:1:364361014,https://github.com/panjf2000/ants/issues/12,,12,潘少,更新下tag吧,"""鄙人现在在弄dep依赖管理,有用到你写的ants项目,可是你好像忘记打最新的tag了。最新的tag 3.6是指向ed55924这个提交,git上的最新代码是af376f1b这次提交,两次提交都隔了快5个月了,看到的话,麻烦打一个最新的tag吧。(手动可怜)""",,,DONE,closed,0,2018-09-28T06:05:58.000+00:00,2018-09-27T08:32:25.000+00:00,2019-04-21T08:19:58.000+00:00,1293,,,0,0,0,github:GithubAccount:1:29452204,edcismybrother,github:GithubAccount:1:0,,,,"{""ConnectionId"":1,""Name"":""panjf2000/ants""}",_raw_github_api_issues,18,
github:GithubIssue:1:381941219,https://github.com/panjf2000/ants/issues/17,,17,关于优雅退出的问题,"""关于这个package优雅退出的问题,我看了一下Release的代码:\r\n\r\n`\r\n\t// Release Closed this pool.\r\n\tfunc (p *PoolWithFunc) Release() error {\r\n\t\tp.once.Do(func() {\r\n\t\t\tp.release <- sig{}\r\n\t\t\tp.lock.Lock()\r\n\t\t\tidleWorkers := p.workers\r\n\t\t\tfor i, w := range idleWorkers {\r\n\t\t\t\tw.args <- nil\r\n\t\t\t\tidleWorkers[i] = nil\r\n\t\t\t}\r\n\t\t\tp.workers = nil\r\n\t\t\tp.lock.Unlock()\r\n\t\t})\r\n\t\treturn nil\r\n\t}\r\n`\r\n\r\nrelease中,好像没有去等待那些已经正在工作的worker处理完它们的工作?\r\n仅仅是回收了空闲的worker\r\n\r\n那么在收到程序退出的信号时候,release是不能确保正在工作的worker能妥善完成工作\r\n\r\n如果想实现比较好退出方式目前好像是:\r\n\r\nReSize(0) \r\n\r\n不知道我理解的对不对?\r\n""",,,DONE,closed,0,2019-01-29T07:24:37.000+00:00,2018-11-18T08:50:31.000+00:00,2019-01-29T07:24:37.000+00:00,103594,,,0,0,0,github:GithubAccount:1:7931755,zplzpl,github:GithubAccount:1:0,,,,"{""ConnectionId"":1,""Name"":""panjf2000/ants""}",_raw_github_api_issues,23,
github:GithubIssue:1:382039050,https://github.com/panjf2000/ants/issues/18,,18,go协程的理解,"""你好楼主,向您请教一个协程和线程的问题,协程基于go进程调度,线程基于系统内核调度,调度协程的过程是先调度线程后获得资源再去调度协程。\""官方解释: GOMAXPROCS sets the maximum number of CPUs that can be executing simultaneously。限制cpu数,本质上是什么,限制并行数?,并行数即同时执行数量?,执行单元即线程?,即限制最大并行线程数量?\""""",,,DONE,closed,0,2018-12-03T03:53:50.000+00:00,2018-11-19T02:59:53.000+00:00,2018-12-03T03:53:50.000+00:00,20213,,,0,0,0,github:GithubAccount:1:13944100,LinuxForYQH,github:GithubAccount:1:0,,,,"{""ConnectionId"":1,""Name"":""panjf2000/ants""}",_raw_github_api_issues,24,
github:GithubIssue:1:382574800,https://github.com/panjf2000/ants/issues/20,,20,是否考虑任务支持回调函数处理失败的逻辑和任务依赖,"""#""",,,DONE,closed,0,2019-01-25T15:34:03.000+00:00,2018-11-20T09:36:02.000+00:00,2019-01-25T15:34:03.000+00:00,95398,,,0,0,0,github:GithubAccount:1:5668717,kklinan,github:GithubAccount:1:0,,,,"{""ConnectionId"":1,""Name"":""panjf2000/ants""}",_raw_github_api_issues,26,
github:GithubIssue:1:388907811,https://github.com/panjf2000/ants/issues/21,,21,Benchmark 下直接使用 Semaphore 似乎更快呢?,"""简单跑了一下 benchmark,Semaphore 更快且很简单\r\n\r\n```bash\r\n$ go test -bench .\r\ngoos: darwin\r\ngoarch: amd64\r\npkg: github.com/panjf2000/ants\r\nBenchmarkGoroutineWithFunc-4 \t 1\t3445631705 ns/op\r\nBenchmarkSemaphoreWithFunc-4 \t 1\t1037219073 ns/op\r\nBenchmarkAntsPoolWithFunc-4 \t 1\t1138053222 ns/op\r\nBenchmarkGoroutine-4 \t 2\t 731850771 ns/op\r\nBenchmarkSemaphore-4 \t 2\t 914855967 ns/op\r\nBenchmarkAntsPool-4 \t 1\t1094379445 ns/op\r\nPASS\r\nok \tgithub.com/panjf2000/ants\t33.173s\r\n```\r\n那 Ants 在什么情况下有优势呢?""",,,DONE,closed,0,2018-12-14T06:01:07.000+00:00,2018-12-08T10:08:17.000+00:00,2018-12-14T06:01:07.000+00:00,8392,,,0,0,0,github:GithubAccount:1:720086,huangjunwen,github:GithubAccount:1:0,,,,"{""ConnectionId"":1,""Name"":""panjf2000/ants""}",_raw_github_api_issues,27,
github:GithubIssue:1:401277739,https://github.com/panjf2000/ants/issues/22,,22,是否考虑 worker 中添加 PanicHandler ?,"""比方说在创建 Pool 的时候传入一个 PanicHandler,然后在每个 worker 创建的时候 recover 之后传给 PanicHandler 处理。否则池子里如果发生 panic 会直接挂掉整个进程。""",,,DONE,closed,0,2019-01-22T05:41:34.000+00:00,2019-01-21T10:06:56.000+00:00,2019-01-22T05:41:34.000+00:00,1174,,,0,0,0,github:GithubAccount:1:8923413,choleraehyq,github:GithubAccount:1:0,,,,"{""ConnectionId"":1,""Name"":""panjf2000/ants""}",_raw_github_api_issues,28,
github:GithubIssue:1:402513849,https://github.com/panjf2000/ants/issues/24,,24,提交任务不阻塞,"""`Pool.Submit`和`PoolWithFunc.Server`提交任务,如果没有空的worker,会一直阻塞。建议增加不阻塞的接口,当前失败时直接返回错误。""",,,DONE,closed,0,2019-08-20T10:56:30.000+00:00,2019-01-24T02:24:13.000+00:00,2019-08-20T10:56:30.000+00:00,300032,,,0,0,0,github:GithubAccount:1:5044825,tenfyzhong,github:GithubAccount:1:0,,,,"{""ConnectionId"":1,""Name"":""panjf2000/ants""}",_raw_github_api_issues,30,
github:GithubIssue:1:405951301,https://github.com/panjf2000/ants/issues/25,,25,use example errors,"""./antstest.go:37:14: cannot use syncCalculateSum (type func()) as type ants.f in argument to ants.Submit\r\n./antstest.go:45:35: cannot use func literal (type func(interface {})) as type ants.pf in argument to ants.NewPoolWithFunc\r\n""",,,DONE,closed,0,2019-02-04T09:11:52.000+00:00,2019-02-02T05:43:38.000+00:00,2019-02-04T09:11:52.000+00:00,3088,,,0,0,0,github:GithubAccount:1:5244267,jiashiwen,github:GithubAccount:1:0,,,,"{""ConnectionId"":1,""Name"":""panjf2000/ants""}",_raw_github_api_issues,31,
github:GithubIssue:1:413968505,https://github.com/panjf2000/ants/issues/26,,26,running可能大于cap的问题,"""running与cap的比较判断与incRuning分开执行的, 可能会出现running大于cap的问题?\r\n`func (p *Pool) retrieveWorker() *Worker {\r\n\tvar w *Worker\r\n\r\n\tp.lock.Lock()\r\n\tidleWorkers := p.workers\r\n\tn := len(idleWorkers) - 1\r\n\tif n >= 0 {\r\n\t\tw = idleWorkers[n]\r\n\t\tidleWorkers[n] = nil\r\n\t\tp.workers = idleWorkers[:n]\r\n\t\tp.lock.Unlock()\r\n\t} else if p.Running() < p.Cap() {\r\n\t\tp.lock.Unlock()\r\n\t\tif cacheWorker := p.workerCache.Get(); cacheWorker != nil {\r\n\t\t\tw = cacheWorker.(*Worker)\r\n\t\t} else {\r\n\t\t\tw = &Worker{\r\n\t\t\t\tpool: p,\r\n\t\t\t\ttask: make(chan func(), workerChanCap),\r\n\t\t\t}\r\n\t\t}\r\n\t\tw.run()`""",,,DONE,closed,0,2019-03-12T12:01:57.000+00:00,2019-02-25T07:29:33.000+00:00,2019-03-12T12:01:57.000+00:00,21872,,,0,0,0,github:GithubAccount:1:10361713,Ainiroad,github:GithubAccount:1:0,,,,"{""ConnectionId"":1,""Name"":""panjf2000/ants""}",_raw_github_api_issues,32,
github:GithubIssue:1:419183961,https://github.com/panjf2000/ants/issues/27,,27,为何goroutine一直上不去,用户量也打不上去,"""为何goroutine一直上不去,用户量也打不上去\r\n是我用的有问题吗?\r\n\r\nwebsocket server\r\nhttps://github.com/im-ai/pushm/blob/master/learn/goroutine/goroutinepoolwebsocket.go\r\n\r\nwebsocket cient\r\nhttps://github.com/im-ai/pushm/blob/master/learn/goroutine/goroutinepoolwebsocketclient.go\r\n""",,,DONE,closed,0,2019-04-05T14:05:20.000+00:00,2019-03-10T13:08:52.000+00:00,2019-04-05T14:05:20.000+00:00,37496,,,0,0,0,github:GithubAccount:1:38367404,liliang8858,github:GithubAccount:1:0,,,,"{""ConnectionId"":1,""Name"":""panjf2000/ants""}",_raw_github_api_issues,33,
github:GithubIssue:1:419268851,https://github.com/panjf2000/ants/issues/28,,28,cap 和 running 比较的问题,"""这是我在 Playground 上面的代码 https://play.golang.org/p/D94YUU3FnX6\r\natomic 只能保证自增自减时的原子操作,在比较过程中,其他线程对变量进行了操作 比较过程并无感知,所以这个比较结果 不是完全正确的,想要实现 比较的数量完全正确,只能在修改和比较两个值的地方加锁\r\n像 #26 说的是对的""",,,DONE,closed,0,2019-08-22T16:27:37.000+00:00,2019-03-11T02:24:41.000+00:00,2019-08-22T16:27:37.000+00:00,237002,,,0,0,0,github:GithubAccount:1:29243953,naiba,github:GithubAccount:1:0,,,,"{""ConnectionId"":1,""Name"":""panjf2000/ants""}",_raw_github_api_issues,34,
github:GithubIssue:1:424634533,https://github.com/panjf2000/ants/issues/29,,29,任务传参,"""你好,你的项目太酷了👍\r\n\r\nhttps://github.com/panjf2000/ants/blob/master/pool.go#L124 貌似不支持带参数的任务, 请问传参是用闭包的方式吗?\r\n""",,,DONE,closed,0,2019-03-25T09:32:11.000+00:00,2019-03-24T16:52:21.000+00:00,2019-03-25T09:45:05.000+00:00,999,,,0,0,0,github:GithubAccount:1:8509898,prprprus,github:GithubAccount:1:0,,,,"{""ConnectionId"":1,""Name"":""panjf2000/ants""}",_raw_github_api_issues,35,
github:GithubIssue:1:429972115,https://github.com/panjf2000/ants/issues/31,,31,Add go.mod,"""""",,,DONE,closed,0,2019-04-08T09:45:31.000+00:00,2019-04-05T23:50:36.000+00:00,2019-10-17T03:12:19.000+00:00,3474,,,0,0,0,github:GithubAccount:1:48135919,tsatke,github:GithubAccount:1:0,,,,"{""ConnectionId"":1,""Name"":""panjf2000/ants""}",_raw_github_api_issues,37,
github:GithubIssue:1:433564955,https://github.com/panjf2000/ants/issues/32,,32,关于版本问题,我发现小版本(0.0.x)这种更新就会不向下兼容?,"""如题,我感觉这样不好。\r\n\r\n功能版本号不向下兼容能理解\r\n\r\n修复问题的版本号也不向下兼容,难以理解。""",,,DONE,closed,0,2019-04-21T07:16:26.000+00:00,2019-04-16T03:16:02.000+00:00,2019-04-21T07:16:26.000+00:00,7440,,,0,0,0,github:GithubAccount:1:7931755,zplzpl,github:GithubAccount:1:0,,,,"{""ConnectionId"":1,""Name"":""panjf2000/ants""}",_raw_github_api_issues,38,
github:GithubIssue:1:434069015,https://github.com/panjf2000/ants/issues/33,,33,support semantic versioning.,"""建议将发布的tag兼容为semantic versioning,vX.Y.Z。go modules对此支持比较良好。\r\nhttps://semver.org/\r\nhttps://research.swtch.com/vgo-import""",,,DONE,closed,0,2019-04-21T08:25:20.000+00:00,2019-04-17T02:55:11.000+00:00,2019-04-21T08:25:20.000+00:00,6090,,,0,0,0,github:GithubAccount:1:1284892,jjeffcaii,github:GithubAccount:1:0,,,,"{""ConnectionId"":1,""Name"":""panjf2000/ants""}",_raw_github_api_issues,39,
github:GithubIssue:1:435486645,https://github.com/panjf2000/ants/issues/34,,34,Important announcement about <ants> from author !!!,"""**Dear users of `ants`:**\r\nI am apologetically telling you that I have to dump all tags which already presents in `ants` repository.\r\n\r\nThe reason why I'm doing so is to standardize the version management with `Semantic Versioning`, which will make a formal and clear dependency management in go, for go modules, godep, or glide, etc. So I decide to start over the tag sequence, you could find more details in [Semantic Versioning](https://semver.org/) and [Semantic Import Versioning](https://research.swtch.com/vgo-import), related issue: #32, #33 (very thankful to @jjeffcaii and @zplzpl who provided the suggestions about it).\r\n\r\nI ought to apologize for the bothers brought by this change, the arch-criminal who leads to this issue would be my lack of concept about `Semantic Versioning`, I will spend more times learning the knowledge afterwards. \r\n\r\nOnce again, sorry for your costs in this change and thanks for your support to `ants`! \r\n\r\n*Have fun!*\r\n\r\n**Best regards,\r\nAndy Pan**\r\n""",,,DONE,closed,0,2019-05-07T15:35:08.000+00:00,2019-04-21T08:10:28.000+00:00,2019-05-07T15:35:08.000+00:00,23484,,,0,0,0,github:GithubAccount:1:7496278,panjf2000,github:GithubAccount:1:0,,,,"{""ConnectionId"":1,""Name"":""panjf2000/ants""}",_raw_github_api_issues,40,
github:GithubIssue:1:461280653,https://github.com/panjf2000/ants/issues/35,,35,worker exit on panic,"""个人认为PanicHandler设计不妥。\r\n1.无PanicHandler时,抛出给外面的不是panic,外层感受不到。\r\n2.无论有没有PanicHandler,都会导致worker退出,最终pool阻塞住全部任务。""",,,DONE,closed,0,2019-08-17T20:33:10.000+00:00,2019-06-27T03:11:49.000+00:00,2019-08-17T20:33:10.000+00:00,74481,,,0,0,0,github:GithubAccount:1:38849208,king526,github:GithubAccount:1:0,,,,"{""ConnectionId"":1,""Name"":""panjf2000/ants""}",_raw_github_api_issues,41,
github:GithubIssue:1:462631417,https://github.com/panjf2000/ants/issues/37,,37,请不要再随意变更版本号了。。。,"""之前用的是 3.9.9,结果今天构建出了问题,一看发现这个版本没了,变成 1.0.0。这种变更完全不考虑现有用户的情况。希望以后不要随意变更了""",,,DONE,closed,0,2019-07-01T12:37:55.000+00:00,2019-07-01T10:17:15.000+00:00,2019-07-02T10:17:31.000+00:00,140,,,0,0,0,github:GithubAccount:1:8923413,choleraehyq,github:GithubAccount:1:0,,,,"{""ConnectionId"":1,""Name"":""panjf2000/ants""}",_raw_github_api_issues,43,
github:GithubIssue:1:472125082,https://github.com/panjf2000/ants/issues/38,,38,retrieveWorker与revertWorker之间会导致死锁,"""func (p *Pool) retrieveWorker() *Worker {\r\n\tvar w *Worker\r\n\r\n\t**p.lock.Lock()**\r\n\tidleWorkers := p.workers\r\n\tn := len(idleWorkers) - 1\r\n\tif n >= 0 {\r\n\t\tw = idleWorkers[n]\r\n\t\tidleWorkers[n] = nil\r\n\t\tp.workers = idleWorkers[:n]\r\n\t\tp.lock.Unlock()\r\n\t} else if p.Running() < p.Cap() {\r\n\t\tp.lock.Unlock()\r\n\t\tif cacheWorker := p.workerCache.Get(); cacheWorker != nil {\r\n\t\t\tw = cacheWorker.(*Worker)\r\n\t\t} else {\r\n\t\t\tw = &Worker{\r\n\t\t\t\tpool: p,\r\n\t\t\t\ttask: make(chan func(), workerChanCap),\r\n\t\t\t}\r\n\t\t}\r\n\t\tw.run()\r\n\t} else {\r\n\t\tfor {\r\n\t\t\t**p.cond.Wait()** \r\n\t\t\tl := len(p.workers) - 1\r\n\t\t\tif l < 0 {\r\n\t\t\t\tcontinue\r\n\t\t\t}\r\n\t\t\tw = p.workers[l]\r\n\t\t\tp.workers[l] = nil\r\n\t\t\tp.workers = p.workers[:l]\r\n\t\t\tbreak\r\n\t\t}\r\n\t\t**p.lock.Unlock()**\r\n\t}\r\n\treturn w\r\n}\r\n\r\n// revertWorker puts a worker back into free pool, recycling the goroutines.\r\nfunc (p *Pool) revertWorker(worker *Worker) bool {\r\n\tif CLOSED == atomic.LoadInt32(&p.release) {\r\n\t\treturn false\r\n\t}\r\n\tworker.recycleTime = time.Now()\r\n\t**p.lock.Lock()** // 协程池满了之后获取不到锁\r\n\tp.workers = append(p.workers, worker)\r\n\t// Notify the invoker stuck in 'retrieveWorker()' of there is an available worker in the worker queue.\r\n\tp.cond.Signal()\r\n\t**p.lock.Unlock()**\r\n\treturn true\r\n}\r\n""",,,DONE,closed,0,2019-07-24T08:40:01.000+00:00,2019-07-24T07:32:58.000+00:00,2019-07-24T08:40:01.000+00:00,67,,,0,0,0,github:GithubAccount:1:1290360,wwjiang,github:GithubAccount:1:0,,,,"{""ConnectionId"":1,""Name"":""panjf2000/ants""}",_raw_github_api_issues,44,
github:GithubIssue:1:483164833,https://github.com/panjf2000/ants/issues/42,,42,带选项的初始化函数,我觉得用 functional options 更好一点,"""以下是示意代码\r\n如果用 functional options,原来的写法是\r\n```\r\nants.NewPool(10)\r\n```\r\n新的写法,如果不加 option,写法是不变的,因为 options 是作为可变参数传进去的。如果要加 option,只需要改成\r\n```\r\nants.NewPool(10, ants.WithNonblocking(true))\r\n```\r\n这样。\r\n\r\n现在是直接传一个 Option 结构体进去,所有的地方都要改,感觉很不优雅。\r\n具体 functional options 的设计可以看 rob pike 的一篇博客 https://commandcenter.blogspot.com/2014/01/self-referential-functions-and-design.html""",,,DONE,closed,0,2019-08-21T14:32:51.000+00:00,2019-08-21T02:20:08.000+00:00,2019-08-21T14:32:51.000+00:00,732,,,0,0,0,github:GithubAccount:1:8923413,choleraehyq,github:GithubAccount:1:0,,,,"{""ConnectionId"":1,""Name"":""panjf2000/ants""}",_raw_github_api_issues,48,
github:GithubIssue:1:483736247,https://github.com/panjf2000/ants/issues/43,,43,1.3.0 是不兼容更新,"""Pool 里那些暴露出来的字段(PanicHandler 之类的)都没了,这是一个不兼容更新,根据语义化版本的要求要发大版本。""",,,DONE,closed,0,2019-08-22T13:22:10.000+00:00,2019-08-22T02:29:34.000+00:00,2019-08-22T13:22:10.000+00:00,652,,,0,0,0,github:GithubAccount:1:8923413,choleraehyq,github:GithubAccount:1:0,,,,"{""ConnectionId"":1,""Name"":""panjf2000/ants""}",_raw_github_api_issues,49,
github:GithubIssue:1:484311063,https://github.com/panjf2000/ants/issues/44,,44,1.1.1 -> 1.2.0 也是不兼容更新,"""Pool.Release 的返回值没了""",,,DONE,closed,0,2019-08-25T06:36:14.000+00:00,2019-08-23T03:27:38.000+00:00,2019-08-25T06:36:14.000+00:00,3068,,,0,0,0,github:GithubAccount:1:8923413,choleraehyq,github:GithubAccount:1:0,,,,"{""ConnectionId"":1,""Name"":""panjf2000/ants""}",_raw_github_api_issues,50,