Skip to content

Commit

Permalink
Merge pull request #1577 from heinezen/fix/jthread
Browse files Browse the repository at this point in the history
Check if clang jthread is joinable before joining
  • Loading branch information
TheJJ authored Oct 17, 2023
2 parents db164ef + 3c92aeb commit a8d033f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libopenage/engine/engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ class jthread : public thread {
jthread(jthread &&) = default;
jthread &operator=(jthread &&) = default;
~jthread() {
this->join();
if (this->joinable()) {
this->join();
}
}
};
} // namespace std
Expand Down

0 comments on commit a8d033f

Please sign in to comment.