Skip to content

Commit

Permalink
move mutex into function as Windows has problems with global mutex in…
Browse files Browse the repository at this point in the history
…itialization (#951)
  • Loading branch information
farindk committed Oct 9, 2023
1 parent 4a628bc commit 01057a6
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions libheif/color-conversion/colorconversion.cc
Original file line number Diff line number Diff line change
Expand Up @@ -207,13 +207,11 @@ std::ostream& operator<<(std::ostream& ostr, const ColorState& state)
}

std::vector<std::shared_ptr<ColorConversionOperation>> ColorConversionPipeline::m_operation_pool;
#if ENABLE_MULTITHREADING_SUPPORT
std::mutex init_ops_mutex;
#endif

void ColorConversionPipeline::init_ops()
{
#if ENABLE_MULTITHREADING_SUPPORT
static std::mutex init_ops_mutex;
std::lock_guard<std::mutex> lock(init_ops_mutex);
#endif
if (!m_operation_pool.empty()) {
Expand Down

0 comments on commit 01057a6

Please sign in to comment.