mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
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:
committed by
Peter Johnson
parent
8757bc471b
commit
e582518bae
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user