MCPcopy
hub / github.com/purpleidea/mgmt / EasyExit

Struct EasyExit

util/sync.go:112–118  ·  view source on GitHub ↗

EasyExit is a struct that helps you build a close switch and signal which can be called multiple times safely, and used as a signal many times in parallel. It can also provide a context, if you prefer to use that as a signal instead.

Source from the content-addressed store, hash-verified

110// be called multiple times safely, and used as a signal many times in parallel.
111// It can also provide a context, if you prefer to use that as a signal instead.
112type EasyExit struct {
113 mutex *sync.Mutex
114 exit chan struct{}
115 once *sync.Once
116 err error
117 wg *sync.WaitGroup
118}
119
120// NewEasyExit builds an easy exit struct.
121func NewEasyExit() *EasyExit {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected