MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / CanClose

Method CanClose

internal/utils/bfs/blocks_file.go:298–308  ·  view source on GitHub ↗

CanClose 检查是否可以关闭

()

Source from the content-addressed store, hash-verified

296
297// CanClose 检查是否可以关闭
298func (this *BlocksFile) CanClose() bool {
299 this.mu.RLock()
300 defer this.mu.RUnlock()
301
302 if len(this.writingFileMap) > 0 || atomic.LoadInt32(&this.countRefs) > 0 {
303 return false
304 }
305
306 this.isClosing = true
307 return true
308}
309
310// Close 关闭当前文件
311func (this *BlocksFile) Close() error {

Callers 2

TestBlocksFile_CanCloseFunction · 0.80
shiftOpenFilesMethod · 0.80

Calls 2

RLockMethod · 0.80
RUnlockMethod · 0.80

Tested by 1

TestBlocksFile_CanCloseFunction · 0.64