Skip to content

Commit b79738b

Browse files
authored
[SYCL][Graph] Fix race in node queries (#17012)
Found by coverity scan.
1 parent 7f20a2b commit b79738b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

sycl/source/detail/graph_impl.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1811,9 +1811,11 @@ void modifiable_command_graph::print_graph(sycl::detail::string_view pathstr,
18111811
}
18121812

18131813
std::vector<node> modifiable_command_graph::get_nodes() const {
1814+
graph_impl::ReadLock Lock(impl->MMutex);
18141815
return createNodesFromImpls(impl->MNodeStorage);
18151816
}
18161817
std::vector<node> modifiable_command_graph::get_root_nodes() const {
1818+
graph_impl::ReadLock Lock(impl->MMutex);
18171819
auto &Roots = impl->MRoots;
18181820
std::vector<std::weak_ptr<node_impl>> Impls{};
18191821

0 commit comments

Comments
 (0)