mirror of
https://github.com/boostorg/geometry.git
synced 2025-05-11 13:34:10 +00:00
[geometry][index]test: shared memory segment created only once to prevent race conditions
[SVN r85009]
This commit is contained in:
parent
c807c701a1
commit
0bb9b192eb
@ -13,8 +13,7 @@ int test_main(int, char* [])
|
|||||||
{
|
{
|
||||||
typedef bg::model::point<float, 2, bg::cs::cartesian> P2f;
|
typedef bg::model::point<float, 2, bg::cs::cartesian> P2f;
|
||||||
|
|
||||||
testset::interprocess::modifiers<P2f>(bgi::linear<32, 8>());
|
testset::interprocess::modifiers_and_additional<P2f>(bgi::linear<32, 8>());
|
||||||
testset::interprocess::additional<P2f>(bgi::linear<32, 8>());
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -13,8 +13,7 @@ int test_main(int, char* [])
|
|||||||
{
|
{
|
||||||
typedef bg::model::point<float, 2, bg::cs::cartesian> P2f;
|
typedef bg::model::point<float, 2, bg::cs::cartesian> P2f;
|
||||||
|
|
||||||
testset::interprocess::modifiers<P2f>(bgi::dynamic_linear(32, 8));
|
testset::interprocess::modifiers_and_additional<P2f>(bgi::dynamic_linear(32, 8));
|
||||||
testset::interprocess::additional<P2f>(bgi::dynamic_linear(32, 8));
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -13,8 +13,7 @@ int test_main(int, char* [])
|
|||||||
{
|
{
|
||||||
typedef bg::model::point<float, 2, bg::cs::cartesian> P2f;
|
typedef bg::model::point<float, 2, bg::cs::cartesian> P2f;
|
||||||
|
|
||||||
testset::interprocess::modifiers<P2f>(bgi::quadratic<32, 8>());
|
testset::interprocess::modifiers_and_additional<P2f>(bgi::quadratic<32, 8>());
|
||||||
testset::interprocess::additional<P2f>(bgi::quadratic<32, 8>());
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -13,8 +13,7 @@ int test_main(int, char* [])
|
|||||||
{
|
{
|
||||||
typedef bg::model::point<float, 2, bg::cs::cartesian> P2f;
|
typedef bg::model::point<float, 2, bg::cs::cartesian> P2f;
|
||||||
|
|
||||||
testset::interprocess::modifiers<P2f>(bgi::dynamic_quadratic(32, 8));
|
testset::interprocess::modifiers_and_additional<P2f>(bgi::dynamic_quadratic(32, 8));
|
||||||
testset::interprocess::additional<P2f>(bgi::dynamic_quadratic(32, 8));
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -13,8 +13,7 @@ int test_main(int, char* [])
|
|||||||
{
|
{
|
||||||
typedef bg::model::point<float, 2, bg::cs::cartesian> P2f;
|
typedef bg::model::point<float, 2, bg::cs::cartesian> P2f;
|
||||||
|
|
||||||
testset::interprocess::modifiers<P2f>(bgi::rstar<32, 8>());
|
testset::interprocess::modifiers_and_additional<P2f>(bgi::rstar<32, 8>());
|
||||||
testset::interprocess::additional<P2f>(bgi::rstar<32, 8>());
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -13,8 +13,7 @@ int test_main(int, char* [])
|
|||||||
{
|
{
|
||||||
typedef bg::model::point<float, 2, bg::cs::cartesian> P2f;
|
typedef bg::model::point<float, 2, bg::cs::cartesian> P2f;
|
||||||
|
|
||||||
testset::interprocess::modifiers<P2f>(bgi::dynamic_rstar(32, 8));
|
testset::interprocess::modifiers_and_additional<P2f>(bgi::dynamic_rstar(32, 8));
|
||||||
testset::interprocess::additional<P2f>(bgi::dynamic_rstar(32, 8));
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -81,4 +81,21 @@ void additional(Parameters const& parameters = Parameters())
|
|||||||
testset::additional<Indexable>(parameters, shmem_alloc(segment.get_segment_manager()));
|
testset::additional<Indexable>(parameters, shmem_alloc(segment.get_segment_manager()));
|
||||||
}
|
}
|
||||||
|
|
||||||
}}
|
template <typename Indexable, typename Parameters>
|
||||||
|
void modifiers_and_additional(Parameters const& parameters = Parameters())
|
||||||
|
{
|
||||||
|
namespace bi = boost::interprocess;
|
||||||
|
struct shm_remove
|
||||||
|
{
|
||||||
|
shm_remove() { bi::shared_memory_object::remove("shmem"); }
|
||||||
|
~shm_remove(){ bi::shared_memory_object::remove("shmem"); }
|
||||||
|
} remover;
|
||||||
|
|
||||||
|
bi::managed_shared_memory segment(bi::create_only, "shmem", 65535);
|
||||||
|
typedef bi::allocator<Indexable, bi::managed_shared_memory::segment_manager> shmem_alloc;
|
||||||
|
|
||||||
|
testset::modifiers<Indexable>(parameters, shmem_alloc(segment.get_segment_manager()));
|
||||||
|
testset::additional<Indexable>(parameters, shmem_alloc(segment.get_segment_manager()));
|
||||||
|
}
|
||||||
|
|
||||||
|
}}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user