mirror of
https://github.com/matrix-construct/construct
synced 2024-12-28 00:14:07 +01:00
ircd::ctx: Add share counter observer to shared_mutex.
This commit is contained in:
parent
e179915008
commit
5b91cbdca1
1 changed files with 8 additions and 0 deletions
|
@ -25,6 +25,7 @@ class ircd::ctx::shared_mutex
|
||||||
void release();
|
void release();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
size_t shares() const;
|
||||||
size_t waiting() const;
|
size_t waiting() const;
|
||||||
|
|
||||||
bool try_lock();
|
bool try_lock();
|
||||||
|
@ -360,6 +361,13 @@ const
|
||||||
return q.size();
|
return q.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline size_t
|
||||||
|
ircd::ctx::shared_mutex::shares()
|
||||||
|
const
|
||||||
|
{
|
||||||
|
return std::max(s, ssize_t(0));
|
||||||
|
}
|
||||||
|
|
||||||
inline void
|
inline void
|
||||||
ircd::ctx::shared_mutex::release()
|
ircd::ctx::shared_mutex::release()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue