make sure unlock safe even if listeners panic (#383)

* make sure unlock safe even if listeners panic

* fix #378

* fix #378
This commit is contained in:
Kevin Wan
2021-01-13 18:43:42 +08:00
committed by GitHub
parent 1f1dcd16e6
commit 37c3b9f5c1
2 changed files with 27 additions and 18 deletions

View File

@@ -4,10 +4,12 @@ package proc
import "time"
// AddShutdownListener returns fn itself on windows, lets callers call fn on their own.
func AddShutdownListener(fn func()) func() {
return fn
}
// AddWrapUpListener returns fn itself on windows, lets callers call fn on their own.
func AddWrapUpListener(fn func()) func() {
return fn
}