MCPcopy Create free account
hub / github.com/facebook/time / StoreFBClockDataV2

Function StoreFBClockDataV2

fbclock/shmem_notlinux.go:241–251  ·  view source on GitHub ↗

StoreFBClockDataV2 writes the primary anchor section. The two sections are independent seqlock sections on separate cache lines, mirroring the C fbclock_shmdata_v2 layout, so each is written by its own call.

(fd uintptr, d DataV2)

Source from the content-addressed store, hash-verified

239// independent seqlock sections on separate cache lines, mirroring the C
240// fbclock_shmdata_v2 layout, so each is written by its own call.
241func StoreFBClockDataV2(fd uintptr, d DataV2) error {
242 data, err := unix.Mmap(int(fd), 0, shmDataV2Size, unix.PROT_READ|unix.PROT_WRITE, unix.MAP_SHARED) //nolint:gosec
243 if err != nil {
244 return fmt.Errorf("mmap failed: %w", err)
245 }
246 defer func() { _ = unix.Munmap(data) }()
247
248 return storeSeqlockSection(data, shmV2PrimarySeqOff, func(buf []byte) {
249 writeClockDataV2(buf, d)
250 })
251}
252
253// StoreFBClockDataRealtime writes the realtime anchor section, used on hosts
254// whose primary is MONOTONIC_RAW. Separate call from StoreFBClockDataV2 so the

Callers 1

populateDataV2Method · 0.92

Calls 2

storeSeqlockSectionFunction · 0.85
writeClockDataV2Function · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…