mirror of
https://github.com/matrix-construct/construct
synced 2024-12-27 07:54:05 +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();
|
||||
|
||||
public:
|
||||
size_t shares() const;
|
||||
size_t waiting() const;
|
||||
|
||||
bool try_lock();
|
||||
|
@ -360,6 +361,13 @@ const
|
|||
return q.size();
|
||||
}
|
||||
|
||||
inline size_t
|
||||
ircd::ctx::shared_mutex::shares()
|
||||
const
|
||||
{
|
||||
return std::max(s, ssize_t(0));
|
||||
}
|
||||
|
||||
inline void
|
||||
ircd::ctx::shared_mutex::release()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue