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{}
|
2020-05-26 19:27:29 +02:00
|
|
|
PrismWorker = 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 {
|
2020-05-26 19:27:29 +02:00
|
|
|
return MainWorker.Busy() || SyncWorker.Busy() || ShareWorker.Busy() || PrismWorker.Busy()
|
2020-05-26 15:15:14 +02:00
|
|
|
}
|