MCPcopy Create free account
hub / github.com/catboost/catboost / GetTransferId

Function GetTransferId

library/cpp/netliba/v6/udp_client_server.cpp:227–235  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

225
226 static TAtomic transferIdCounter = (long)(GetCycleCount() & 0x1fffffff);
227 inline int GetTransferId() {
228 int res = AtomicAdd(transferIdCounter, 1);
229 while (res < 0) {
230 // negative transfer ids are treated as errors, so wrap transfer id
231 AtomicCas(&transferIdCounter, 0, transferIdCounter);
232 res = AtomicAdd(transferIdCounter, 1);
233 }
234 return res;
235 }
236
237 static bool IBDetection = true;
238 class TUdpHost: public IUdpHost {

Callers 1

SendMethod · 0.85

Calls 2

AtomicAddFunction · 0.50
AtomicCasFunction · 0.50

Tested by

no test coverage detected