1df0d9a549
See https://twitter.com/browseyourlife/status/1265289044856123393 Signed-off-by: Michael Mayer <michael@liquidbytes.net>
18 lines
330 B
Go
18 lines
330 B
Go
package mutex
|
|
|
|
import (
|
|
"sync"
|
|
)
|
|
|
|
var (
|
|
Db = sync.Mutex{}
|
|
MainWorker = Busy{}
|
|
SyncWorker = Busy{}
|
|
ShareWorker = Busy{}
|
|
PrismWorker = Busy{}
|
|
)
|
|
|
|
// WorkersBusy returns true if any worker is busy.
|
|
func WorkersBusy() bool {
|
|
return MainWorker.Busy() || SyncWorker.Busy() || ShareWorker.Busy() || PrismWorker.Busy()
|
|
}
|