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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user