mirror of
https://github.com/boostorg/thread.git
synced 2026-01-22 17:52:18 +00:00
Added "unspecified" read-write sync policy, for use in read-write mutex tests
[SVN r33564]
This commit is contained in:
@@ -18,7 +18,8 @@ namespace boost
|
||||
writer_priority,
|
||||
reader_priority,
|
||||
alternating_many_reads,
|
||||
alternating_single_read
|
||||
alternating_single_read,
|
||||
unspecified=writer_priority
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -834,7 +834,7 @@ void test_multiple_readers()
|
||||
|
||||
boost::thread_group pool;
|
||||
|
||||
boost::read_write_mutex rw_mutex;
|
||||
boost::read_write_mutex rw_mutex(::boost::read_write_scheduling_policy::unspecified);
|
||||
unsigned unblocked_count=0;
|
||||
boost::mutex unblocked_count_mutex;
|
||||
boost::mutex finish_mutex;
|
||||
@@ -858,7 +858,7 @@ void test_reader_blocks_writer()
|
||||
{
|
||||
boost::thread_group pool;
|
||||
|
||||
boost::read_write_mutex rw_mutex;
|
||||
boost::read_write_mutex rw_mutex(::boost::read_write_scheduling_policy::unspecified);
|
||||
unsigned unblocked_count=0;
|
||||
boost::mutex unblocked_count_mutex;
|
||||
boost::mutex finish_mutex;
|
||||
@@ -884,7 +884,7 @@ void test_only_one_writer_permitted()
|
||||
|
||||
boost::thread_group pool;
|
||||
|
||||
boost::read_write_mutex rw_mutex;
|
||||
boost::read_write_mutex rw_mutex(::boost::read_write_scheduling_policy::unspecified);
|
||||
unsigned unblocked_count=0;
|
||||
boost::mutex unblocked_count_mutex;
|
||||
boost::mutex finish_mutex;
|
||||
@@ -910,7 +910,7 @@ void test_unlocking_writer_unblocks_all_readers()
|
||||
{
|
||||
boost::thread_group pool;
|
||||
|
||||
boost::read_write_mutex rw_mutex;
|
||||
boost::read_write_mutex rw_mutex(::boost::read_write_scheduling_policy::unspecified);
|
||||
boost::read_write_mutex::scoped_write_lock write_lock(rw_mutex);
|
||||
unsigned unblocked_count=0;
|
||||
boost::mutex unblocked_count_mutex;
|
||||
@@ -939,7 +939,7 @@ void test_unlocking_last_reader_only_unblocks_one_writer()
|
||||
{
|
||||
boost::thread_group pool;
|
||||
|
||||
boost::read_write_mutex rw_mutex;
|
||||
boost::read_write_mutex rw_mutex(::boost::read_write_scheduling_policy::unspecified);
|
||||
unsigned unblocked_count=0;
|
||||
boost::mutex unblocked_count_mutex;
|
||||
boost::mutex finish_reading_mutex;
|
||||
|
||||
Reference in New Issue
Block a user