- Remove custom atomicBool implementation
- Replace all atomicBool usages with standard library sync/atomic.Bool
Signed-off-by: Xiaobo Liu <cppcoffee@gmail.com>
operations.go use slice as queue o.ops = o.ops[1:]
The memory allocated for the array is never returned.
For a long-living queue you should probably use a dynamic
data structure, such as a linked list.
Fixes#1857
Operations is now essentially a slice protected by a single lock. No
lock is held during execution, serialisation is guaranteed by ensuring
that there is at most one goroutine running at a time. A coincidental
benefit is that we now won't deadlock if an operation panics.
While this should be slightly faster, the main point of this change is
to reduce the amount of noise in the blocking profile.