Skip to content

Commit

Permalink
[SYCL][ClangLinkerWrapper] Fix race condition (#12378)
Browse files Browse the repository at this point in the history
This patch fixes a data race in the following line of the code that is
supposed to be run parallelly and needs mutex protection.

WrappedOutput.push_back(*SYCLOutputOrErr);
  • Loading branch information
maksimsab committed Mar 1, 2024
1 parent 9e155c9 commit ea400f7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1796,6 +1796,7 @@ Expected<SmallVector<StringRef>> linkAndWrapDeviceFiles(
// separate path inside 'linkDevice' call seen above.
// This will eventually be refactored to use the 'common' wrapping logic
// that is used for other offload kinds.
std::scoped_lock Guard(ImageMtx);
WrappedOutput.push_back(*SYCLOutputOrErr);
}

Expand Down

0 comments on commit ea400f7

Please sign in to comment.