[unit-tests] add failing test.
You currently can get a read lock when a write lock is already held.
This commit is contained in:
parent
666a32da9c
commit
36169d399c
@ -233,6 +233,13 @@ TEST(BlockTests, concurrent_read_locks)
|
||||
bm->read_lock(0);
|
||||
}
|
||||
|
||||
TEST(BlockTests, no_concurrent_read_and_write_locks)
|
||||
{
|
||||
bm4096::ptr bm = create_bm<4096>();
|
||||
bm4096::write_ref wr = bm->write_lock(0);
|
||||
ASSERT_THROW(bm->read_lock(0), runtime_error);
|
||||
}
|
||||
|
||||
TEST(BlockTests, read_then_write)
|
||||
{
|
||||
bm4096::ptr bm = create_bm<4096>();
|
||||
|
Loading…
Reference in New Issue
Block a user