2020-01-08 19:51:21 +01:00
|
|
|
package mutex
|
|
|
|
|
|
|
|
import (
|
|
|
|
"sync"
|
|
|
|
)
|
|
|
|
|
2020-04-03 18:08:49 +02:00
|
|
|
var (
|
2020-05-26 15:15:14 +02:00
|
|
|
Db = sync.Mutex{}
|
|
|
|
MainWorker = Busy{}
|
|
|
|
SyncWorker = Busy{}
|
|
|
|
ShareWorker = Busy{}
|
|
|
|
GroomWorker = Busy{}
|
2020-04-03 18:08:49 +02:00
|
|
|
)
|
2020-05-26 15:15:14 +02:00
|
|
|
|
|
|
|
// WorkersBusy returns true if any worker is busy.
|
|
|
|
func WorkersBusy() bool {
|
|
|
|
return MainWorker.Busy() || SyncWorker.Busy() || ShareWorker.Busy() || GroomWorker.Busy()
|
|
|
|
}
|