Close 关闭当前文件
()
| 309 | |
| 310 | // Close 关闭当前文件 |
| 311 | func (this *BlocksFile) Close() error { |
| 312 | this.mu.Lock() |
| 313 | defer this.mu.Unlock() |
| 314 | |
| 315 | if this.isClosed { |
| 316 | return nil |
| 317 | } |
| 318 | |
| 319 | // TODO 决定是否同步 |
| 320 | //_ = this.sync(true) |
| 321 | |
| 322 | this.isClosed = true |
| 323 | |
| 324 | _ = this.mFile.Close() |
| 325 | |
| 326 | this.closeReaderPool() |
| 327 | |
| 328 | return this.fp.Close() |
| 329 | } |
| 330 | |
| 331 | // IsClosing 判断当前文件是否正在关闭或者已关闭 |
| 332 | func (this *BlocksFile) IsClosing() bool { |
nothing calls this directly
no test coverage detected