MCPcopy Index your code
hub / github.com/git-bug/git-bug / MemClock

Struct MemClock

util/lamport/mem_clock.go:47–49  ·  view source on GitHub ↗

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.

Source from the content-addressed store, hash-verified

45// uses efficient atomic operations for all of its functions, falling back
46// to a heavy lock only if there are enough CAS failures.
47type MemClock struct {
48 counter uint64
49}
50
51// NewMemClock create a new clock with the value 1.
52// Value 0 is considered as invalid.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected