Files
MapLibreParticleLab/src/mbgl/actor/scheduler.cpp
Ivo van Dongen edaa002c3c [core] current scheduler
- Adds a way to set the current scheduler on the thread to be used whenever a mailbox is created that needs to reply on this thread
2017-08-09 12:08:21 +03:00

20 lines
370 B
C++

#include <mbgl/actor/scheduler.hpp>
#include <mbgl/util/thread_local.hpp>
namespace mbgl {
static auto& current() {
static util::ThreadLocal<Scheduler> scheduler;
return scheduler;
};
void Scheduler::SetCurrent(Scheduler* scheduler) {
current().set(scheduler);
}
Scheduler* Scheduler::GetCurrent() {
return current().get();
}
} //namespace mbgl