diff options
author | Thiago Marcos P. Santos <thiago@mapbox.com> | 2015-06-23 20:08:30 +0300 |
---|---|---|
committer | Thiago Marcos P. Santos <thiago@mapbox.com> | 2015-06-25 16:26:21 +0300 |
commit | a8b6b67dfeb79a2e7904a2aec6354161c4eb1b16 (patch) | |
tree | ffe6ebd296b440287979f8df74b9f59da0ee998d /test/miscellaneous | |
parent | 7bb86368d4730c889f9b1f7007a7bada580db8ea (diff) | |
download | qtlocation-mapboxgl-a8b6b67dfeb79a2e7904a2aec6354161c4eb1b16.tar.gz |
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.
Diffstat (limited to 'test/miscellaneous')
-rw-r--r-- | test/miscellaneous/map_context.cpp | 2 | ||||
-rw-r--r-- | test/miscellaneous/thread.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/test/miscellaneous/map_context.cpp b/test/miscellaneous/map_context.cpp index 15061b1225..6e9ed85c3f 100644 --- a/test/miscellaneous/map_context.cpp +++ b/test/miscellaneous/map_context.cpp @@ -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, "", ""); diff --git a/test/miscellaneous/thread.cpp b/test/miscellaneous/thread.cpp index b0dd2210e9..9767bc4b79 100644 --- a/test/miscellaneous/thread.cpp +++ b/test/miscellaneous/thread.cpp @@ -64,7 +64,7 @@ TEST(Thread, invoke) { loop.invoke([&] { EXPECT_EQ(tid, std::this_thread::get_id()); - Thread<TestObject> thread("Test", ThreadPriority::Regular, tid); + Thread<TestObject> thread({"Test", ThreadType::Map, ThreadPriority::Regular}, tid); thread.invoke(&TestObject::fn1, 1); thread.invokeWithResult<int>(&TestObject::fn2, [&] (int result) { |