Skip to content

Commit 17ba301

Browse files
authored
Merge pull request #3 from dennwc/fuse-break
Report if fuse was broken by a call to Break
2 parents 40396d0 + a7ff582 commit 17ba301

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

fuse.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,13 @@ func (f *Fuse) Watch() <-chan struct{} {
5656
return f.c
5757
}
5858

59-
// Break breaks the fuse
60-
func (f *Fuse) Break() {
61-
f.Once(nil)
59+
// Break breaks the fuse. It returns true if it was broken by this call.
60+
func (f *Fuse) Break() bool {
61+
broken := false
62+
f.Once(func() {
63+
broken = true
64+
})
65+
return broken
6266
}
6367

6468
// Once runs the callback and breaks the fuse

0 commit comments

Comments
 (0)