Skip to content

Commit

Permalink
Revert change from omp critical section to atomic write, because Wind…
Browse files Browse the repository at this point in the history
…ows.
  • Loading branch information
crisluengo committed Jan 14, 2025
1 parent 9a54d3b commit 6592a1b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/binary/sup_inf_generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -502,13 +502,16 @@ class ThickeningThinningLineFilter : public Framework::FullLineFilter {
mask += maskStride;
}
if( changed ) {
#pragma omp atomic write
// TODO: This is more efficient with `#pragma omp atomic write`. But MSVC support that only since 17.4 (2022).
// And we'd also need CMake 3.30 or later to enable the MSVC option that enables MSVC to support it.
// So for the time being we keep using this, but should update at some point in the future.
#pragma omp critical( SupInfGeneratingLineFilter )
changed_ = true;
}
}
private:
DirectionMode const mode_;
bool& changed_; // use atomic construct to set!
bool& changed_; // shared among threads, write atomically!
Image const& mask_;
std::vector< dip::sint > offsets_;
std::vector< dip::bin > hitmiss_;
Expand Down

0 comments on commit 6592a1b

Please sign in to comment.