2a24bf293d
Signed-off-by: Michael Mayer <michael@liquidbytes.net>
18 lines
329 B
Go
18 lines
329 B
Go
package mutex
|
|
|
|
import (
|
|
"sync"
|
|
)
|
|
|
|
var (
|
|
Db = sync.Mutex{}
|
|
MainWorker = Busy{}
|
|
SyncWorker = Busy{}
|
|
ShareWorker = Busy{}
|
|
MetaWorker = Busy{}
|
|
)
|
|
|
|
// WorkersBusy returns true if any worker is busy.
|
|
func WorkersBusy() bool {
|
|
return MainWorker.Busy() || SyncWorker.Busy() || ShareWorker.Busy() || MetaWorker.Busy()
|
|
}
|