core: prevent static initialization issue with Time::Resolution on Cppyy 3
This commit is contained in:
@@ -653,8 +653,7 @@ class Time
|
||||
*/
|
||||
static inline Resolution* PeekResolution()
|
||||
{
|
||||
static Time::Resolution& resolution{SetDefaultNsResolution()};
|
||||
return &resolution;
|
||||
return &m_resolution;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -832,7 +831,8 @@ class Time
|
||||
friend Time& operator-=(Time& lhs, const Time& rhs);
|
||||
/**@}*/ // Compound assignment
|
||||
|
||||
int64_t m_data; //!< Virtual time value, in the current unit.
|
||||
int64_t m_data; //!< Virtual time value, in the current unit.
|
||||
static Time::Resolution m_resolution; //!< The current time resolution
|
||||
|
||||
}; // class Time
|
||||
|
||||
|
||||
@@ -91,6 +91,9 @@ Time::MarkedTimes* Time::g_markingTimes = nullptr;
|
||||
/// The static mutex for critical sections around modification of Time::g_markingTimes.
|
||||
static std::mutex g_markingMutex;
|
||||
|
||||
// The resolution of the Time class
|
||||
Time::Resolution Time::m_resolution{SetDefaultNsResolution()};
|
||||
|
||||
// Function called to force static initialization
|
||||
// static
|
||||
bool
|
||||
|
||||
Reference in New Issue
Block a user