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

Function ProcessCancel

engine/dlib/src/test/test_job_system.cpp:145–159  ·  view source on GitHub ↗

When the first finished job arrives, we'll cancel the rest of the tasks

Source from the content-addressed store, hash-verified

143
144// When the first finished job arrives, we'll cancel the rest of the tasks
145static int32_t ProcessCancel(HJobContext ctx, HJob job, void* user_context, void* user_data)
146{
147 ContextCancel* context = (ContextCancel*)user_context;
148 dmAtomicIncrement32(&context->m_NumProcessed);
149
150 uint64_t t = (uint64_t)(uintptr_t)user_data;
151
152 for (uint32_t i = 0; i < context->m_JobsToCancel.Size(); ++i)
153 {
154 JobSystemCancelJob(ctx, context->m_JobsToCancel[i]);
155 }
156
157 dmTime::Sleep(t);
158 return 1;
159}
160
161static void CallbackCancel(HJobContext ctx, HJob job, JobSystemStatus status, void* user_context, void* user_data, int32_t user_result)
162{

Callers

nothing calls this directly

Calls 4

dmAtomicIncrement32Function · 0.85
JobSystemCancelJobFunction · 0.85
SleepFunction · 0.50
SizeMethod · 0.45

Tested by

no test coverage detected