AtomicMax is a thread-safe max container - hasValue indicator true if a value was equal to or greater than threshold - optional threshold for minimum accepted max value - if threshold is not used, initialization-free - — - wait-free CompareAndSwap mechanic
| 21 | // - — |
| 22 | // - wait-free CompareAndSwap mechanic |
| 23 | type AtomicMax struct { |
| 24 | |
| 25 | // value is current max |
| 26 | value atomic.Float64 |
| 27 | // whether [AtomicMax.Value] has been invoked |
| 28 | // with value equal or greater to threshold |
| 29 | hasValue atomic.Bool |
| 30 | } |
| 31 | |
| 32 | // NewAtomicMax returns a thread-safe max container |
| 33 | // - if threshold is not used, AtomicMax is initialization-free |
nothing calls this directly
no outgoing calls
no test coverage detected