Its maybe not a race condition?
This commit is contained in:
@@ -157,6 +157,7 @@ void BasePass::render()
|
||||
command->bindDescriptor(descriptorSets);
|
||||
if (graphics->supportMeshShading())
|
||||
{
|
||||
std::cout << "Num Meshes: " << instance.meshes.size() << std::endl;
|
||||
command->dispatch(instance.meshes.size(), 1, 1);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -7,15 +7,14 @@ TEST(ThreadPool, RunBatch)
|
||||
ThreadPool t(10);
|
||||
uint32 test = 20;
|
||||
std::mutex m;
|
||||
List<Task> work;
|
||||
List<std::function<void()>> work;
|
||||
for (uint32 i = 0; i < 400; ++i)
|
||||
{
|
||||
work.add([&]() -> Task {
|
||||
work.add([&]() {
|
||||
std::unique_lock l(m);
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(10));
|
||||
test++;
|
||||
co_return;
|
||||
}());
|
||||
});
|
||||
}
|
||||
t.runAndWait(std::move(work));
|
||||
ASSERT_EQ(test, 420);
|
||||
|
||||
Reference in New Issue
Block a user