Skip to content

Commit

Permalink
fix the random crash for UT with multi-thread run
Browse files Browse the repository at this point in the history
  • Loading branch information
HectorSVC committed Sep 19, 2024
1 parent bd60add commit 511f782
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion onnxruntime/core/providers/qnn/qnn_execution_provider.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ constexpr const char* QNN = "QNN";
static std::unique_ptr<std::vector<std::function<void()>>> s_run_on_unload_;

void RunOnUnload(std::function<void()> function) {
OrtMutex mutex;
static OrtMutex mutex;
std::lock_guard<OrtMutex> guard(mutex);
if (!s_run_on_unload_) {
s_run_on_unload_ = std::make_unique<std::vector<std::function<void()>>>();
Expand Down

0 comments on commit 511f782

Please sign in to comment.