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

Method CheckIn

internal/sync/exclusive_pool.go:39–51  ·  view source on GitHub ↗

CheckIn checks in an instance to the pool and hangs while instance with same identity is using the lock.

(identity string)

Source from the content-addressed store, hash-verified

37// CheckIn checks in an instance to the pool and hangs while instance
38// with same identity is using the lock.
39func (p *ExclusivePool) CheckIn(identity string) {
40 p.lock.Lock()
41
42 lock, has := p.pool[identity]
43 if !has {
44 lock = &sync.Mutex{}
45 p.pool[identity] = lock
46 }
47 p.count[identity]++
48
49 p.lock.Unlock()
50 lock.Lock()
51}
52
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.

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