Skip to content

Commit

Permalink
Merge branch 'auric-patch-1' into develop
Browse files Browse the repository at this point in the history
see #345
  • Loading branch information
AzothAmmo committed Oct 12, 2016
2 parents f4ae56a + 8c1517d commit fc57d93
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions include/cereal/details/static_object.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ namespace cereal
static LockGuard lock()
{
#if CEREAL_THREAD_SAFE
static std::mutex instanceMutex;
return LockGuard{instanceMutex};
#else
return LockGuard{};
Expand All @@ -117,15 +118,9 @@ namespace cereal

private:
static T & instance;
#if CEREAL_THREAD_SAFE
static std::mutex instanceMutex;
#endif
};

template <class T> T & StaticObject<T>::instance = StaticObject<T>::create();
#if CEREAL_THREAD_SAFE
template <class T> std::mutex StaticObject<T>::instanceMutex;
#endif
} // namespace detail
} // namespace cereal

Expand Down

0 comments on commit fc57d93

Please sign in to comment.