mirror of
https://github.com/matrix-construct/construct
synced 2025-03-14 05:20:17 +01:00
ircd::ctx: Assert release sequence is happening on ctx.
This commit is contained in:
parent
f61d0a30ec
commit
b8aba99ed4
2 changed files with 8 additions and 0 deletions
|
@ -92,6 +92,7 @@ ircd::ctx::mutex::lock()
|
|||
if(likely(try_lock()))
|
||||
return;
|
||||
|
||||
assert(current);
|
||||
q.push_back(current);
|
||||
while(!try_lock())
|
||||
wait();
|
||||
|
@ -111,6 +112,7 @@ ircd::ctx::mutex::try_lock_until(const time_point &tp)
|
|||
if(likely(try_lock()))
|
||||
return true;
|
||||
|
||||
assert(current);
|
||||
q.push_back(current);
|
||||
while(!try_lock())
|
||||
{
|
||||
|
@ -152,6 +154,8 @@ template<class queue>
|
|||
void
|
||||
ircd::ctx::release_sequence(queue &q)
|
||||
{
|
||||
assert(current);
|
||||
|
||||
ctx *next; do
|
||||
{
|
||||
if(!q.empty())
|
||||
|
|
|
@ -240,6 +240,7 @@ ircd::ctx::shared_mutex::lock_upgrade()
|
|||
if(likely(try_lock_upgrade()))
|
||||
return;
|
||||
|
||||
assert(current);
|
||||
q.push_back(current);
|
||||
while(!try_lock_upgrade())
|
||||
wait();
|
||||
|
@ -251,6 +252,7 @@ ircd::ctx::shared_mutex::lock_shared()
|
|||
if(likely(try_lock_shared()))
|
||||
return;
|
||||
|
||||
assert(current);
|
||||
q.push_back(current);
|
||||
while(!try_lock_shared())
|
||||
wait();
|
||||
|
@ -262,6 +264,7 @@ ircd::ctx::shared_mutex::lock()
|
|||
if(likely(try_lock()))
|
||||
return;
|
||||
|
||||
assert(current);
|
||||
q.push_back(current);
|
||||
while(!try_lock())
|
||||
wait();
|
||||
|
@ -311,6 +314,7 @@ ircd::ctx::shared_mutex::try_lock_until(time_point&& tp)
|
|||
if(likely(try_lock()))
|
||||
return true;
|
||||
|
||||
assert(current);
|
||||
q.push_back(current);
|
||||
while(!try_lock())
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue