Fix some move constructors (#1754)

Timer didn't have working move semantics because mutexes aren't
moveable, meaning the default implementations were ill-formed.
MotorSafety wasn't locking its mutex.
This commit is contained in:
Tyler Veness
2019-07-07 19:15:59 -07:00
committed by Peter Johnson
parent 8757bc471b
commit e582518bae
3 changed files with 19 additions and 2 deletions

View File

@@ -39,6 +39,8 @@ MotorSafety::MotorSafety(MotorSafety&& rhs)
m_stopTime(std::move(rhs.m_stopTime)) {}
MotorSafety& MotorSafety::operator=(MotorSafety&& rhs) {
std::scoped_lock lock(m_thisMutex, rhs.m_thisMutex);
ErrorBase::operator=(std::move(rhs));
m_expiration = std::move(rhs.m_expiration);