MCPcopy Create free account
hub / github.com/defold/defold / GetHostByNameThreadWorker

Function GetHostByNameThreadWorker

engine/dlib/src/dlib/socket.cpp:101–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99 };
100
101 static void GetHostByNameThreadWorker(void* arg)
102 {
103 GetHostByNameThreadContext* ctx = (GetHostByNameThreadContext*)arg;
104 ctx->m_Result = GetHostByName(ctx->m_Name, &ctx->m_Address, ctx->m_Ipv4, ctx->m_Ipv6);
105
106 if (dmAtomicIncrement32(&ctx->m_Finished)+1 == 2)
107 {
108 // The calling thread was already finished, waiting for this thread.
109 free((void*)ctx->m_Name);
110 delete ctx;
111 }
112 }
113
114#if defined(__EMSCRIPTEN__)
115 Result GetHostByNameT(const char* name, Address* address, uint64_t timeout, int* cancelflag, bool ipv4, bool ipv6)

Callers

nothing calls this directly

Calls 3

dmAtomicIncrement32Function · 0.85
freeFunction · 0.85
GetHostByNameFunction · 0.70

Tested by

no test coverage detected