0
0
Fork 0
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:
Jason Volk 2018-08-26 18:01:12 -07:00
parent 26d062e3f7
commit 3a8f3c58de

View file

@ -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()
{