mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-12-02 05:50:25 +08:00
bfs:同一个Hash同时只能有一个Writer,避免多线程读冲突
This commit is contained in:
@@ -233,6 +233,11 @@ func (this *MetaFile) FileHeader(hash string) (header *FileHeader, ok bool) {
|
||||
return
|
||||
}
|
||||
|
||||
func (this *MetaFile) FileHeaderUnsafe(hash string) (header *FileHeader, ok bool) {
|
||||
header, ok = this.headerMap[hash]
|
||||
return
|
||||
}
|
||||
|
||||
func (this *MetaFile) CloneFileHeader(hash string) (header *FileHeader, ok bool) {
|
||||
this.mu.RLock()
|
||||
defer this.mu.RUnlock()
|
||||
|
||||
Reference in New Issue
Block a user