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

Function JobSystemUpdate

engine/dlib/src/dlib/jobsystem.cpp:705–724  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

703}
704
705void JobSystemUpdate(HJobContext context, uint64_t time_limit)
706{
707 DM_PROFILE("JobThreadUpdate");
708
709 if (!context->m_UseThreads)
710 {
711 UpdateSingleThread(&context->m_ThreadContext, time_limit);
712 }
713
714 // Lock for as little as possible, by copying the items to an array owned by this thread
715 jc::RingBuffer<HJob> items;
716
717 {
718 DM_MUTEX_OPTIONAL_SCOPED_LOCK(context->m_ThreadContext.m_Mutex);
719 items.Swap(context->m_ThreadContext.m_Done);
720 }
721
722 // Now do the callbacks
723 ProcessFinishedJobs(context, items);
724}
725static void DebugPrintJob(JobThreadContext* ctx, HJob hjob)
726{
727 uint32_t generation = ToGeneration(hjob);

Callers 14

UpdateFunction · 0.85
TEST_PFunction · 0.85
StepFrameFunction · 0.85
DoCreateResourceFunction · 0.85
TEST_FFunction · 0.85
FontGenFlushFinishedJobsFunction · 0.85
UpdateAndWaitUntilDoneFunction · 0.85
TEST_FFunction · 0.85
TEST_FFunction · 0.85

Calls 3

UpdateSingleThreadFunction · 0.85
ProcessFinishedJobsFunction · 0.85
SwapMethod · 0.45

Tested by 9

TEST_PFunction · 0.68
TEST_FFunction · 0.68
UpdateAndWaitUntilDoneFunction · 0.68
TEST_FFunction · 0.68
TEST_FFunction · 0.68
EngineUpdateFunction · 0.68