Introduce the ThreadContext

mbgl::Thread will keep a ThreadContext for each running instance
in a thread_local so we don't need to lookup a man in the Environment
every time we need some info about the current thread.

This patch is moving the ::currentlyOn check used on Debug build from
the Environment class to the ThreadContext.
This commit is contained in:
Thiago Marcos P. Santos
2015-06-23 20:08:30 +03:00
parent 7bb86368d4
commit a8b6b67dfe
14 changed files with 128 additions and 36 deletions

View File

@@ -15,7 +15,7 @@ TEST(MapContext, DoubleStyleLoad) {
DefaultFileSource fileSource(nullptr);
MapData data(view, MapMode::Continuous);
util::Thread<MapContext> context("Map", util::ThreadPriority::Regular, view, fileSource, data);
util::Thread<MapContext> context({"Map", util::ThreadType::Map, util::ThreadPriority::Regular}, view, fileSource, data);
context.invokeSync(&MapContext::setStyleJSON, "", "");
context.invokeSync(&MapContext::setStyleJSON, "", "");