MCPcopy Create free account
hub / github.com/TypesettingTools/Aegisub / Init

Function Init

libaegisub/common/dispatch.cpp:78–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76namespace agi::dispatch {
77
78void Init(std::function<void (Thunk)>&& invoke_main) {
79 static IOServiceThreadPool thread_pool;
80 ::service = &thread_pool.io_context;
81 ::invoke_main = invoke_main;
82
83 thread_pool.threads.reserve(std::max<unsigned>(4, std::thread::hardware_concurrency()));
84 for (size_t i = 0; i < thread_pool.threads.capacity(); ++i) {
85 thread_pool.threads.emplace_back([]{
86 ++threads_running;
87 agi::util::SetThreadName("Dispatch Worker");
88 service->run();
89 --threads_running;
90 });
91 }
92}
93
94void Queue::Async(Thunk&& thunk) {
95 DoInvoke([=] {

Callers 10

mainFunction · 0.85
mainFunction · 0.85
PClipMethod · 0.85
PVideoFrameMethod · 0.85
SetColorSpaceMethod · 0.85
AvisynthVideoProviderMethod · 0.85
PClipMethod · 0.85
PVideoFrameMethod · 0.85
OnInitMethod · 0.85
mainFunction · 0.85

Calls 1

SetThreadNameFunction · 0.50

Tested by 1

mainFunction · 0.68