MCPcopy Create free account
hub / github.com/aseprite/laf / execute

Method execute

base/thread_pool.cpp:29–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27}
28
29const thread_pool::work* thread_pool::execute(std::function<void()>&& func)
30{
31 thread_pool::work_ptr work = std::make_unique<thread_pool::work>(std::move(func));
32 const thread_pool::work* result = work.get();
33 const std::unique_lock lock(m_mutex);
34 ASSERT(m_running);
35 m_work.push_back(std::move(work));
36 m_cv.notify_one();
37 return result;
38}
39
40bool thread_pool::try_pop(const work* w)
41{

Callers 2

TESTFunction · 0.80
task.cppFile · 0.80

Calls 1

getMethod · 0.45

Tested by 1

TESTFunction · 0.64