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

Function AcquireSocket

engine/dlib/src/dlib/message.cpp:273–294  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

271 }
272
273 static MessageSocket* AcquireSocket(HSocket socket)
274 {
275 if (dmAtomicGet32(&g_ContextDestroyer.m_Deleted))
276 {
277 return 0; // The system has already been shut down
278 }
279
280 DM_SPINLOCK_SCOPED_LOCK(g_MessageSpinlock);
281
282 MessageSocket* s = g_MessageContext->m_Sockets.Get(socket);
283
284 if (s == 0x0)
285 {
286 return 0x0;
287 }
288
289 assert(s->m_RefCount >= 1);
290
291 ++s->m_RefCount;
292
293 return s;
294 }
295
296 Result DeleteSocket(HSocket socket)
297 {

Callers 3

HasMessagesFunction · 0.85
PostFunction · 0.85
InternalDispatchFunction · 0.85

Calls 3

dmAtomicGet32Function · 0.85
assertFunction · 0.50
GetMethod · 0.45

Tested by

no test coverage detected