bloomberg / quantum

Powerful multi-threaded coroutine dispatcher and parallel execution engine
Apache License 2.0
572 stars 94 forks source link

Correctly set writer in ReadWriteMutex::tryUpgradeToWrite(), add tests #131

Closed arosenzweig3 closed 4 years ago

arosenzweig3 commented 4 years ago

Describe your changes Fixed a bug where ReadWriteMutex::tryUpgradeToWrite() did not properly set the write-lock owner, so unlockWrite() operations were asserting. Refined an existing assert to be easier to understand.

Testing performed Added additional unit tests to verify this case.