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

Function JobSystemCreateJob

engine/dlib/src/dlib/jobsystem.cpp:254–285  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

252}
253
254HJob JobSystemCreateJob(HJobContext context, Job* job)
255{
256 JobThreadContext* ctx = &context->m_ThreadContext;
257
258 uint32_t index;
259 uint64_t generation;
260 JobItem* item;
261 {
262 DM_MUTEX_OPTIONAL_SCOPED_LOCK(ctx->m_Mutex);
263
264 if (ctx->m_Items.Full())
265 ctx->m_Items.OffsetCapacity(64);
266
267 index = ctx->m_Items.Alloc();
268 generation = ctx->m_Generation++;
269 item = &ctx->m_Items.Get(index);
270 }
271
272 memset(item, 0, sizeof(JobItem));
273
274 item->m_TimeCreated = dmTime::GetMonotonicTime();
275 item->m_Job = *job;
276 item->m_Generation = generation;
277 item->m_Status = JOBSYSTEM_STATUS_CREATED;
278 item->m_Parent = INVALID_JOB;
279 item->m_Sibling = INVALID_JOB;
280 item->m_FirstChild = INVALID_JOB;
281 item->m_LastChild = INVALID_JOB;
282
283 HJob hjob = MakeHandle(generation, index);
284 return hjob;
285}
286
287JobSystemResult JobSystemPushJob(HJobContext context, HJob hjob)
288{

Callers 14

PushAsyncJobFunction · 0.85
PushJobFunction · 0.85
PushJobMethod · 0.85
TEST_PFunction · 0.85
PreloadDataFunction · 0.85
CreateSentinelJobFunction · 0.85
GenerateGlyphJobByIndexFunction · 0.85
DispatchRequestFunction · 0.85
NullDeleteTextureAsyncFunction · 0.85
NullSetTextureAsyncFunction · 0.85
OpenGLDeleteTextureAsyncFunction · 0.85

Calls 6

AllocMethod · 0.80
GetMonotonicTimeFunction · 0.70
MakeHandleFunction · 0.70
FullMethod · 0.45
OffsetCapacityMethod · 0.45
GetMethod · 0.45

Tested by 3

PushJobFunction · 0.68
PushJobMethod · 0.68
TEST_PFunction · 0.68