MemClock is a thread safe implementation of a lamport clock. It uses efficient atomic operations for all of its functions, falling back to a heavy lock only if there are enough CAS failures.
| 45 | // uses efficient atomic operations for all of its functions, falling back |
| 46 | // to a heavy lock only if there are enough CAS failures. |
| 47 | type MemClock struct { |
| 48 | counter uint64 |
| 49 | } |
| 50 | |
| 51 | // NewMemClock create a new clock with the value 1. |
| 52 | // Value 0 is considered as invalid. |
nothing calls this directly
no outgoing calls
no test coverage detected