summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--state.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/state.go b/state.go
index af29de50..4d8b1eaa 100644
--- a/state.go
+++ b/state.go
@@ -68,6 +68,11 @@ func (s *state) String() string {
return "undefined"
}
+// NumExecs returns number of registered worker execs.
+func (s *state) NumExecs() int64 {
+ return atomic.LoadInt64(&s.numExecs)
+}
+
// Value state returns state value
func (s *state) Value() int64 {
return atomic.LoadInt64(&s.value)
@@ -79,10 +84,6 @@ func (s *state) IsActive() bool {
return state == StateWorking || state == StateReady
}
-func (s *state) NumExecs() int64 {
- return atomic.LoadInt64(&s.numExecs)
-}
-
// change state value (status)
func (s *state) set(value int64) {
atomic.StoreInt64(&s.value, value)