MCPcopy Create free account
hub / github.com/KhronosGroup/KTX-Software / wait_for_all

Method wait_for_all

external/basisu/encoder/basisu_enc.cpp:1576–1595  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1574 }
1575
1576 void job_pool::wait_for_all()
1577 {
1578 std::unique_lock<std::mutex> lock(m_mutex);
1579
1580 // Drain the job queue on the calling thread.
1581 while (!m_queue.empty())
1582 {
1583 std::function<void()> job(m_queue.back());
1584 m_queue.pop_back();
1585
1586 lock.unlock();
1587
1588 job();
1589
1590 lock.lock();
1591 }
1592
1593 // The queue is empty, now wait for all active jobs to finish up.
1594 m_no_more_jobs.wait(lock, [this]{ return !m_num_active_jobs; } );
1595 }
1596
1597 void job_pool::job_thread(uint32_t index)
1598 {

Calls 3

waitMethod · 0.80
emptyMethod · 0.45
pop_backMethod · 0.45

Tested by

no test coverage detected