Skip to content

Commit

Permalink
Moving mutex lock to start of function to try to diagnose WinCalc tes…
Browse files Browse the repository at this point in the history
…t errors.
  • Loading branch information
StephenCzarnecki committed Jan 15, 2025
1 parent 9d6b867 commit 9d4fe2b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/SingleLayerOptics/src/MaterialDescription.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -451,13 +451,13 @@ namespace SingleLayerOptics
const CBeamDirection & t_IncomingDirection,
const CBeamDirection &) const
{
std::lock_guard lock(m_CacheMutex);

CacheKey key{t_Property,
t_Side,
t_IncomingDirection.theta(),
m_AngularSample.getBandWavelengths().size()};

std::lock_guard lock(m_CacheMutex);

// Check if the result is already cached
auto it = m_Cache.find(key);
if(it != m_Cache.end())
Expand Down

0 comments on commit 9d4fe2b

Please sign in to comment.