MCPcopy Create free account
hub / github.com/gogs/gogs / CheckOut

Method CheckOut

internal/sync/exclusive_pool.go:55–66  ·  view source on GitHub ↗

CheckOut checks out an instance from the pool and releases the lock to let other instances with same identity to grab the lock.

(identity string)

Source from the content-addressed store, hash-verified

53// CheckOut checks out an instance from the pool and releases the lock
54// to let other instances with same identity to grab the lock.
55func (p *ExclusivePool) CheckOut(identity string) {
56 p.lock.Lock()
57 defer p.lock.Unlock()
58
59 p.pool[identity].Unlock()
60 if p.count[identity] == 1 {
61 delete(p.pool, identity)
62 delete(p.count, identity)
63 } else {
64 p.count[identity]--
65 }
66}

Callers 9

updateWikiPageMethod · 0.80
DeleteWikiPageMethod · 0.80
testPatchMethod · 0.80
UpdateRepoFileMethod · 0.80
GetDiffPreviewMethod · 0.80
DeleteRepoFileMethod · 0.80
UploadRepoFilesMethod · 0.80
deleteRepoLocalCopyFunction · 0.80
CreateNewBranchMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected