You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After an Atomic_RW_Mutex is unlocked using sync.shared_unlock any thread waiting to acquire the rw mutex using sync.lock continues past the lock.
Current Behavior
Theads waiting on acquiring an exclusive lock appear to wait forever if they attempt to acquire the exclusive lock while a thread has a shared lock. Even when the other thread releases the shared lock later.
Failure Information (for bugs)
Steps to Reproduce
In the below code I would expect that tast1 would run and acquire the RW Mutex for reading. Then task2 would try to acquire the RW Mutex for writing, would wait for task1 to release it then would continue though the code.
However, When I run the code, I get
before lock
task1 done
Then the program appears to wait on acquiring the lock for writing forever.
This patch simplifies the implementation and fixesodin-lang#5254.
Previously, the mutex was set up as if there could be multiple writers,
and there seemed to be some confusion as to which `Writer` bits to
check, as not all were checked or set at the same time.
This could also result in the mutex being left in a non-zero state even
after unlocking all locks.
All unneeded state has been removed and extra checks have been put in
place.
Context
Expected Behavior
After an Atomic_RW_Mutex is unlocked using
sync.shared_unlock
any thread waiting to acquire the rw mutex usingsync.lock
continues past the lock.Current Behavior
Theads waiting on acquiring an exclusive lock appear to wait forever if they attempt to acquire the exclusive lock while a thread has a shared lock. Even when the other thread releases the shared lock later.
Failure Information (for bugs)
Steps to Reproduce
In the below code I would expect that tast1 would run and acquire the RW Mutex for reading. Then task2 would try to acquire the RW Mutex for writing, would wait for task1 to release it then would continue though the code.
However, When I run the code, I get
Then the program appears to wait on acquiring the lock for writing forever.
Failure Logs
The text was updated successfully, but these errors were encountered: