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

Method bind

modules/core/task/src/task.cpp:29–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27}
28
29void scheduler_t::bind()
30{
31 SKR_ASSERT(scheduler == nullptr);
32 SKR_ASSERT(internal == nullptr);
33 internal = new ftl::TaskScheduler();
34 options.Callbacks.Context = this;
35 options.Callbacks.OnWorkerThreadStarted = [](void* context, unsigned threadIndex)
36 {
37 scheduler = (scheduler_t*)context;
38 ftl::BindScheduler(scheduler->internal);
39 };
40 options.Callbacks.OnWorkerThreadEnded = [](void* context, unsigned threadIndex)
41 {
42 scheduler = nullptr;
43 ftl::UnbindScheduler();
44 };
45 internal->Init(options);
46 scheduler = this;
47 ftl::BindScheduler(internal);
48}
49void scheduler_t::unbind()
50{
51 SKR_ASSERT(internal);

Callers 10

compile_allFunction · 0.45
bindFunction · 0.45
on_loadMethod · 0.45
mainFunction · 0.45
InitializeMethod · 0.45
on_loadMethod · 0.45
scheduler_test.cppFile · 0.45
WithBoundSchedulerMethod · 0.45
TestCallsMethod · 0.45
Task2Method · 0.45

Calls 1

InitMethod · 0.45

Tested by 2

WithBoundSchedulerMethod · 0.36
TestCallsMethod · 0.36