diff options
author | Wolfy-J <[email protected]> | 2018-06-11 22:02:15 +0300 |
---|---|---|
committer | Wolfy-J <[email protected]> | 2018-06-11 22:02:15 +0300 |
commit | 6c94e7aee2a61e9b073ab574faa7c243ec8f6064 (patch) | |
tree | 6b7891c25d526c16333e04276f6b81d43e6c8119 /state.go | |
parent | fe104ea854572c7033a471e0f5dd0749d8180a70 (diff) |
no library dependency
Diffstat (limited to 'state.go')
-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) |