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

Function PutDone

engine/dlib/src/dlib/jobsystem.cpp:411–438  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

409}
410
411static void PutDone(JobThreadContext* ctx, HJob hjob, JobSystemStatus status, int32_t result)
412{
413 DM_MUTEX_OPTIONAL_SCOPED_LOCK(ctx->m_Mutex);
414
415 uint32_t generation = ToGeneration(hjob);
416 uint32_t index = ToIndex(hjob);
417 JobItem& item = ctx->m_Items.Get(index);
418 assert(item.m_Generation == generation);
419
420 if (status == JOBSYSTEM_STATUS_FINISHED && item.m_CancelRequested)
421 {
422 status = JOBSYSTEM_STATUS_CANCELED;
423 result = 0;
424 }
425
426 item.m_Status = status;
427 item.m_Result = result;
428
429 if (ctx->m_Done.Full())
430 ctx->m_Done.OffsetCapacity(16);
431 ctx->m_Done.Push(hjob);
432
433 if (item.m_Parent != INVALID_JOB)
434 {
435 JobItem& parent = ctx->m_Items.Get(item.m_Parent);
436 dmAtomicIncrement32(&parent.m_NumChildrenCompleted);
437 }
438}
439
440static void CancelAllJobs(HJobContext context)
441{

Callers 3

CancelAllJobsFunction · 0.85
ProcessOneJobFunction · 0.85
SelectAndPopJobFunction · 0.85

Calls 8

ToGenerationFunction · 0.85
ToIndexFunction · 0.85
dmAtomicIncrement32Function · 0.85
assertFunction · 0.50
GetMethod · 0.45
FullMethod · 0.45
OffsetCapacityMethod · 0.45
PushMethod · 0.45

Tested by

no test coverage detected