MCPcopy Create free account
hub / github.com/SakuraEngine/SakuraEngine / enqueue

Method enqueue

modules/core/task/src/task2.cpp:324–342  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

322 }
323
324 void enqueue(Task&& task, bool pinned)
325 {
326 if(!pinned)
327 {
328 work.num++;
329 auto notify = work.notifyAdded;
330 work.tasks.push(std::move(task));
331 if (notify)
332 {
333 skr_wake_condition_var(&work.added);
334 }
335 return;
336 }
337 else
338 {
339 skr_mutex_acquire(&work.mutex);
340 enqueuePinnedAndUnlock(std::move(task));
341 }
342 }
343
344 void enqueuePinnedAndUnlock(Task&& task)
345 {

Callers 2

pushMethod · 0.45
enqueueFunction · 0.45

Calls 4

moveFunction · 0.50
skr_wake_condition_varFunction · 0.50
skr_mutex_acquireFunction · 0.50
pushMethod · 0.45

Tested by

no test coverage detected