|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r85009 - trunk/libs/geometry/index/test/rtree/interprocess
From: adam.wulkiewicz_at_[hidden]
Date: 2013-07-12 12:45:06
Author: awulkiew
Date: 2013-07-12 12:45:06 EDT (Fri, 12 Jul 2013)
New Revision: 85009
URL: http://svn.boost.org/trac/boost/changeset/85009
Log:
[geometry][index]test: shared memory segment created only once to prevent race conditions
Text files modified:
trunk/libs/geometry/index/test/rtree/interprocess/rtree_interprocess_linear.cpp | 3 +--
trunk/libs/geometry/index/test/rtree/interprocess/rtree_interprocess_linear_dyn.cpp | 3 +--
trunk/libs/geometry/index/test/rtree/interprocess/rtree_interprocess_quadratic.cpp | 3 +--
trunk/libs/geometry/index/test/rtree/interprocess/rtree_interprocess_quadratic_dyn.cpp | 3 +--
trunk/libs/geometry/index/test/rtree/interprocess/rtree_interprocess_rstar.cpp | 3 +--
trunk/libs/geometry/index/test/rtree/interprocess/rtree_interprocess_rstar_dyn.cpp | 3 +--
trunk/libs/geometry/index/test/rtree/interprocess/test_interprocess.hpp | 19 ++++++++++++++++++-
7 files changed, 24 insertions(+), 13 deletions(-)
Modified: trunk/libs/geometry/index/test/rtree/interprocess/rtree_interprocess_linear.cpp
==============================================================================
--- trunk/libs/geometry/index/test/rtree/interprocess/rtree_interprocess_linear.cpp Fri Jul 12 12:13:34 2013 (r85008)
+++ trunk/libs/geometry/index/test/rtree/interprocess/rtree_interprocess_linear.cpp 2013-07-12 12:45:06 EDT (Fri, 12 Jul 2013) (r85009)
@@ -13,8 +13,7 @@
{
typedef bg::model::point<float, 2, bg::cs::cartesian> P2f;
- testset::interprocess::modifiers<P2f>(bgi::linear<32, 8>());
- testset::interprocess::additional<P2f>(bgi::linear<32, 8>());
+ testset::interprocess::modifiers_and_additional<P2f>(bgi::linear<32, 8>());
return 0;
}
Modified: trunk/libs/geometry/index/test/rtree/interprocess/rtree_interprocess_linear_dyn.cpp
==============================================================================
--- trunk/libs/geometry/index/test/rtree/interprocess/rtree_interprocess_linear_dyn.cpp Fri Jul 12 12:13:34 2013 (r85008)
+++ trunk/libs/geometry/index/test/rtree/interprocess/rtree_interprocess_linear_dyn.cpp 2013-07-12 12:45:06 EDT (Fri, 12 Jul 2013) (r85009)
@@ -13,8 +13,7 @@
{
typedef bg::model::point<float, 2, bg::cs::cartesian> P2f;
- testset::interprocess::modifiers<P2f>(bgi::dynamic_linear(32, 8));
- testset::interprocess::additional<P2f>(bgi::dynamic_linear(32, 8));
+ testset::interprocess::modifiers_and_additional<P2f>(bgi::dynamic_linear(32, 8));
return 0;
}
Modified: trunk/libs/geometry/index/test/rtree/interprocess/rtree_interprocess_quadratic.cpp
==============================================================================
--- trunk/libs/geometry/index/test/rtree/interprocess/rtree_interprocess_quadratic.cpp Fri Jul 12 12:13:34 2013 (r85008)
+++ trunk/libs/geometry/index/test/rtree/interprocess/rtree_interprocess_quadratic.cpp 2013-07-12 12:45:06 EDT (Fri, 12 Jul 2013) (r85009)
@@ -13,8 +13,7 @@
{
typedef bg::model::point<float, 2, bg::cs::cartesian> P2f;
- testset::interprocess::modifiers<P2f>(bgi::quadratic<32, 8>());
- testset::interprocess::additional<P2f>(bgi::quadratic<32, 8>());
+ testset::interprocess::modifiers_and_additional<P2f>(bgi::quadratic<32, 8>());
return 0;
}
Modified: trunk/libs/geometry/index/test/rtree/interprocess/rtree_interprocess_quadratic_dyn.cpp
==============================================================================
--- trunk/libs/geometry/index/test/rtree/interprocess/rtree_interprocess_quadratic_dyn.cpp Fri Jul 12 12:13:34 2013 (r85008)
+++ trunk/libs/geometry/index/test/rtree/interprocess/rtree_interprocess_quadratic_dyn.cpp 2013-07-12 12:45:06 EDT (Fri, 12 Jul 2013) (r85009)
@@ -13,8 +13,7 @@
{
typedef bg::model::point<float, 2, bg::cs::cartesian> P2f;
- testset::interprocess::modifiers<P2f>(bgi::dynamic_quadratic(32, 8));
- testset::interprocess::additional<P2f>(bgi::dynamic_quadratic(32, 8));
+ testset::interprocess::modifiers_and_additional<P2f>(bgi::dynamic_quadratic(32, 8));
return 0;
}
Modified: trunk/libs/geometry/index/test/rtree/interprocess/rtree_interprocess_rstar.cpp
==============================================================================
--- trunk/libs/geometry/index/test/rtree/interprocess/rtree_interprocess_rstar.cpp Fri Jul 12 12:13:34 2013 (r85008)
+++ trunk/libs/geometry/index/test/rtree/interprocess/rtree_interprocess_rstar.cpp 2013-07-12 12:45:06 EDT (Fri, 12 Jul 2013) (r85009)
@@ -13,8 +13,7 @@
{
typedef bg::model::point<float, 2, bg::cs::cartesian> P2f;
- testset::interprocess::modifiers<P2f>(bgi::rstar<32, 8>());
- testset::interprocess::additional<P2f>(bgi::rstar<32, 8>());
+ testset::interprocess::modifiers_and_additional<P2f>(bgi::rstar<32, 8>());
return 0;
}
Modified: trunk/libs/geometry/index/test/rtree/interprocess/rtree_interprocess_rstar_dyn.cpp
==============================================================================
--- trunk/libs/geometry/index/test/rtree/interprocess/rtree_interprocess_rstar_dyn.cpp Fri Jul 12 12:13:34 2013 (r85008)
+++ trunk/libs/geometry/index/test/rtree/interprocess/rtree_interprocess_rstar_dyn.cpp 2013-07-12 12:45:06 EDT (Fri, 12 Jul 2013) (r85009)
@@ -13,8 +13,7 @@
{
typedef bg::model::point<float, 2, bg::cs::cartesian> P2f;
- testset::interprocess::modifiers<P2f>(bgi::dynamic_rstar(32, 8));
- testset::interprocess::additional<P2f>(bgi::dynamic_rstar(32, 8));
+ testset::interprocess::modifiers_and_additional<P2f>(bgi::dynamic_rstar(32, 8));
return 0;
}
Modified: trunk/libs/geometry/index/test/rtree/interprocess/test_interprocess.hpp
==============================================================================
--- trunk/libs/geometry/index/test/rtree/interprocess/test_interprocess.hpp Fri Jul 12 12:13:34 2013 (r85008)
+++ trunk/libs/geometry/index/test/rtree/interprocess/test_interprocess.hpp 2013-07-12 12:45:06 EDT (Fri, 12 Jul 2013) (r85009)
@@ -81,4 +81,21 @@
testset::additional<Indexable>(parameters, shmem_alloc(segment.get_segment_manager()));
}
-}}
\ No newline at end of file
+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()));
+}
+
+}}
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk