[Util] Non-determinism of `reader_writer_mutex`
When running the unittests in parallel on the current main
(#a31e12da) in a shared debug build, test cases are failing non-deterministically.
$ pipenv run utils/unittest-parallel.py build/debug_shared/bin/unittest
Filters: "reader_writer_mutex/reader_writer_lock/4_readers_2_upgrades"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
unittest is a Catch v2.13.10 host application.
Run with -? for options
-------------------------------------------------------------------------------
reader_writer_mutex/reader_writer_lock/4_readers_2_upgrades
-------------------------------------------------------------------------------
/Users/luca/mutable-org/mutable/unittest/util/reader_writer_lock_test.cpp:138
...............................................................................
/Users/luca/mutable-org/mutable/unittest/util/reader_writer_lock_test.cpp:204: FAILED:
CHECK( r3 == 1 )
with expansion:
3 == 1
===============================================================================
test cases: 1 | 1 failed
assertions: 7 | 6 passed | 1 failed
Filters: "reader_writer_mutex/read_lock_write_lock/3_readers_2_writers"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
unittest is a Catch v2.13.10 host application.
Run with -? for options
-------------------------------------------------------------------------------
reader_writer_mutex/read_lock_write_lock/3_readers_2_writers
-------------------------------------------------------------------------------
/Users/luca/mutable-org/mutable/unittest/util/reader_writer_lock_test.cpp:87
...............................................................................
/Users/luca/mutable-org/mutable/unittest/util/reader_writer_lock_test.cpp:134: FAILED:
CHECK( r2 == 3 )
with expansion:
1 == 3