0
0
Fork 0
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:
Jason Volk 2018-03-26 18:47:29 -07:00
parent e179915008
commit 5b91cbdca1

View file

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