Skip to content

Commit

Permalink
Making flag thread safe
Browse files Browse the repository at this point in the history
  • Loading branch information
eldakms committed Sep 1, 2016
1 parent 6d1d2bf commit f3c1d25
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Source/Common/Globals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@

namespace Microsoft { namespace MSR { namespace CNTK {

bool Globals::m_forceDeterministicAlgorithms = false;
std::atomic<bool> Globals::m_forceDeterministicAlgorithms = false;

}}}
4 changes: 3 additions & 1 deletion Source/Common/Include/Globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

#pragma once

#include <atomic>

namespace Microsoft { namespace MSR { namespace CNTK {

// Class containing global configuration for CNTK.
Expand All @@ -22,6 +24,6 @@ namespace Microsoft { namespace MSR { namespace CNTK {
}

private:
static bool m_forceDeterministicAlgorithms;
static std::atomic<bool> m_forceDeterministicAlgorithms;
};
}}}

0 comments on commit f3c1d25

Please sign in to comment.