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

Function writer_thread

fbclock/cpp_test/test.cpp:69–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67 EXPECT_EQ(data.holdover_multiplier_ns, read_data.holdover_multiplier_ns);
68
69 remove(test_shm);
70}
71
72int writer_thread(int sfd_rw, int tries) {
73 int err;
74 fbclock_clockdata data = {
75 .ingress_time_ns = 1, .error_bound_ns = 2, .holdover_multiplier_ns = 3};
76 for (int i = 0; i < tries; i++) {
77 err = fbclock_clockdata_store_data(sfd_rw, &data);
78 if (err != 0) {
79 return err;
80 }
81 data.ingress_time_ns = data.ingress_time_ns + 1;
82 if (data.ingress_time_ns > 10000) {
83 data.ingress_time_ns = 1;
84 }
85 data.error_bound_ns = data.ingress_time_ns * 2;
86 data.holdover_multiplier_ns = data.ingress_time_ns * 3;
87 }
88 return 0;
89}

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…