diff options
-rw-r--r-- | state.go | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -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) |