[qt] Only build core platform as part of main maplibre-native repo (#1740)

This commit is contained in:
Tadej Novak
2023-11-21 17:13:04 +01:00
committed by GitHub
parent 98860f4cd2
commit 3aacc0aae8
59 changed files with 97 additions and 6288 deletions

View File

@@ -4,16 +4,16 @@
#include <cassert>
namespace QMapLibreGL {
namespace QMapLibre {
Scheduler::Scheduler() {}
Scheduler::Scheduler() = default;
Scheduler::~Scheduler() {
MBGL_VERIFY_THREAD(tid);
}
void Scheduler::schedule(std::function<void()> function) {
std::lock_guard<std::mutex> lock(m_taskQueueMutex);
const std::lock_guard<std::mutex> lock(m_taskQueueMutex);
m_taskQueue.push(std::move(function));
// Need to force the main thread to wake
@@ -24,15 +24,17 @@ void Scheduler::schedule(std::function<void()> function) {
void Scheduler::processEvents() {
std::queue<std::function<void()>> taskQueue;
{
std::unique_lock<std::mutex> lock(m_taskQueueMutex);
const std::unique_lock<std::mutex> lock(m_taskQueueMutex);
std::swap(taskQueue, m_taskQueue);
}
while (!taskQueue.empty()) {
auto& function = taskQueue.front();
if (function) function();
if (function) {
function();
}
taskQueue.pop();
}
}
} // namespace QMapLibreGL
} // namespace QMapLibre