CanClose 检查是否可以关闭
()
| 296 | |
| 297 | // CanClose 检查是否可以关闭 |
| 298 | func (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 关闭当前文件 |
| 311 | func (this *BlocksFile) Close() error { |