Fast implementation of Git in pure Go
codeberg.org/lindenii/furgit
git
go
1package commitquery
2
3// release resets one worker and returns it to the idle pool if there is room.
4func (queries *Queries) release(q *query) {
5 q.resetForReuse()
6
7 queries.mu.Lock()
8 defer queries.mu.Unlock()
9
10 if len(queries.idle) >= queries.maxIdle {
11 return
12 }
13
14 queries.idle = append(queries.idle, q)
15}