mirror of
https://github.com/matrix-construct/construct
synced 2024-11-25 16:22:35 +01:00
ircd::ctx: Add some indicators on shared_mutex.
This commit is contained in:
parent
26d062e3f7
commit
3a8f3c58de
1 changed files with 16 additions and 0 deletions
|
@ -25,6 +25,8 @@ class ircd::ctx::shared_mutex
|
|||
void release();
|
||||
|
||||
public:
|
||||
bool unique() const;
|
||||
bool upgrade() const;
|
||||
size_t shares() const;
|
||||
size_t waiting() const;
|
||||
|
||||
|
@ -372,6 +374,20 @@ const
|
|||
return std::max(s, ssize_t(0));
|
||||
}
|
||||
|
||||
inline bool
|
||||
ircd::ctx::shared_mutex::upgrade()
|
||||
const
|
||||
{
|
||||
return u;
|
||||
}
|
||||
|
||||
inline bool
|
||||
ircd::ctx::shared_mutex::unique()
|
||||
const
|
||||
{
|
||||
return s == std::numeric_limits<decltype(s)>::min();
|
||||
}
|
||||
|
||||
inline void
|
||||
ircd::ctx::shared_mutex::release()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue