a/math: Add lock for relation history get_size

This commit is contained in:
Mateo de Mayo 2023-09-07 11:38:50 -03:00 committed by Jakob Bornecrantz
parent f0ce16288f
commit ce929e804c
2 changed files with 4 additions and 3 deletions

View file

@ -236,8 +236,9 @@ m_relation_history_get_latest(struct m_relation_history *rh,
} }
uint32_t uint32_t
m_relation_history_get_size(const struct m_relation_history *rh) m_relation_history_get_size(struct m_relation_history *rh)
{ {
std::unique_lock<os::Mutex> lock(rh->mutex);
return (uint32_t)rh->impl.size(); return (uint32_t)rh->impl.size();
} }

View file

@ -109,7 +109,7 @@ m_relation_history_get_latest(struct m_relation_history *rh,
* @public @memberof m_relation_history * @public @memberof m_relation_history
*/ */
uint32_t uint32_t
m_relation_history_get_size(const struct m_relation_history *rh); m_relation_history_get_size(struct m_relation_history *rh);
/*! /*!
* Clears the history from all of the items. * Clears the history from all of the items.
@ -199,7 +199,7 @@ public:
* @copydoc m_relation_history_get_size * @copydoc m_relation_history_get_size
*/ */
size_t size_t
size() const noexcept size() noexcept
{ {
return m_relation_history_get_size(mPtr); return m_relation_history_get_size(mPtr);
} }