Set sets the value of the atomic int. Callers must ensure that invocations of this are protected by a mutex or are otherwise safe to call concurrently, since value can overwrite any previous value.
(value int64)
| 1240 | |
| 1241 | // Set sets the value of the atomic int. Callers must ensure that invocations of this are protected by a mutex or are otherwise safe to call concurrently, since value can overwrite any previous value. |
| 1242 | func (ai *AtomicInt) Set(value int64) { |
| 1243 | atomic.StoreInt64(&ai.val, value) |
| 1244 | } |
| 1245 | |
| 1246 | // SetIfMax sets the value of the atomic int to the given value if the given value is greater than the current value. |
| 1247 | func (ai *AtomicInt) SetIfMax(value int64) { |
no outgoing calls