aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--util/interrupt/cleaner.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/util/interrupt/cleaner.go b/util/interrupt/cleaner.go
index 42f925c4..38c8425b 100644
--- a/util/interrupt/cleaner.go
+++ b/util/interrupt/cleaner.go
@@ -33,7 +33,12 @@ func RegisterCleaner(cleaner CleanerFunc) CancelFunc {
defer mu.Unlock()
w := &wrapper{f: cleaner}
- cancel := func() { w.disabled = true }
+
+ cancel := func() {
+ mu.Lock()
+ defer mu.Unlock()
+ w.disabled = true
+ }
// prepend to later execute then in reverse order
cleaners = append([]*wrapper{w}, cleaners...)