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-06-29 13:35:38 +02:00
|
|
|
MetaWorker = 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-06-29 13:35:38 +02:00
|
|
|
return MainWorker.Busy() || SyncWorker.Busy() || ShareWorker.Busy() || MetaWorker.Busy()
|
2020-05-26 15:15:14 +02:00
|
|
|
}
|