go-zero icon indicating copy to clipboard operation
go-zero copied to clipboard

Potential leak in pool.go

Open hhheiaenia opened this issue 2 years ago • 2 comments

I notice that all the p.cond.Wait() and p.cond.Signal() are protected by the mutex lock r.cond.L.Lock() in the file https://github.com/zeromicro/go-zero/blob/master/core/syncx/pool.go#LL82C16-L82C16. So I doubt whether this situation can cause a deadlock.

Maybe what I said is not right, thank you for taking a look.

hhheiaenia avatar May 28 '23 09:05 hhheiaenia

p.cond.Wait() automatically unlock the p.cond.L.

You can refer to the golang docs.

kevwan avatar May 28 '23 12:05 kevwan

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar May 29 '24 01:05 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Aug 27 '24 01:08 github-actions[bot]