mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-01 12:46:12 +00:00
a/math: Add lock for relation history get_size
This commit is contained in:
parent
f0ce16288f
commit
ce929e804c
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue