diff options
| author | Chris Lu <chris.lu@gmail.com> | 2020-08-23 15:48:02 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2020-08-23 15:48:02 -0700 |
| commit | aee27ccbe131578b8627022165d17a972153f0a0 (patch) | |
| tree | 196e2fd4ecc191197c6c3b56e2466a547ff85283 /weed/util/bounded_tree/bounded_tree.go | |
| parent | c19245886c39fcc7f25db5d3963e7cbe40fa786f (diff) | |
| download | seaweedfs-aee27ccbe131578b8627022165d17a972153f0a0.tar.xz seaweedfs-aee27ccbe131578b8627022165d17a972153f0a0.zip | |
multiple fixes
* adjust isOpen count
* move ContinuousDirtyPages lock to filehandle
* fix problem with MergeIntoVisibles, avoid reusing slices
* let filer delete the garbage
Diffstat (limited to 'weed/util/bounded_tree/bounded_tree.go')
| -rw-r--r-- | weed/util/bounded_tree/bounded_tree.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/weed/util/bounded_tree/bounded_tree.go b/weed/util/bounded_tree/bounded_tree.go index 40b9c4e47..0e023c0d1 100644 --- a/weed/util/bounded_tree/bounded_tree.go +++ b/weed/util/bounded_tree/bounded_tree.go @@ -15,7 +15,7 @@ type Node struct { type BoundedTree struct { root *Node - sync.Mutex + sync.RWMutex } func NewBoundedTree() *BoundedTree { @@ -131,6 +131,9 @@ func (n *Node) getChild(childName string) *Node { func (t *BoundedTree) HasVisited(p util.FullPath) bool { + t.RLock() + defer t.RUnlock() + if t.root == nil { return true } |
