mirror of
https://github.com/boostorg/unordered.git
synced 2025-07-30 19:37:14 +02:00
upgraded to boost::process::v2
This commit is contained in:
@ -4,10 +4,11 @@
|
|||||||
|
|
||||||
#include <boost/unordered/concurrent_flat_map.hpp>
|
#include <boost/unordered/concurrent_flat_map.hpp>
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
|
#include <boost/asio.hpp>
|
||||||
#include <boost/core/lightweight_test.hpp>
|
#include <boost/core/lightweight_test.hpp>
|
||||||
#include <boost/interprocess/allocators/allocator.hpp>
|
#include <boost/interprocess/allocators/allocator.hpp>
|
||||||
#include <boost/interprocess/managed_shared_memory.hpp>
|
#include <boost/interprocess/managed_shared_memory.hpp>
|
||||||
#include <boost/process/child.hpp>
|
#include <boost/process/process.hpp>
|
||||||
#include <boost/uuid/random_generator.hpp>
|
#include <boost/uuid/random_generator.hpp>
|
||||||
#include <boost/uuid/uuid_io.hpp>
|
#include <boost/uuid/uuid_io.hpp>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
@ -57,9 +58,11 @@ int parent(const char* exe_name)
|
|||||||
allocator(segment.get_segment_manager()));
|
allocator(segment.get_segment_manager()));
|
||||||
std::atomic_int& start = *segment.construct<std::atomic_int>(start_name)(0);
|
std::atomic_int& start = *segment.construct<std::atomic_int>(start_name)(0);
|
||||||
|
|
||||||
std::vector<boost::process::child> children;
|
boost::asio::io_context ctx;
|
||||||
|
std::vector<boost::process::process> children;
|
||||||
for (int i = 0; i < NUM_CHILDS; ++i) {
|
for (int i = 0; i < NUM_CHILDS; ++i) {
|
||||||
children.emplace_back(exe_name, std::to_string(i), segment_name);
|
children.push_back(boost::process::process(
|
||||||
|
ctx.get_executor(), exe_name, {std::to_string(i), segment_name_str}));
|
||||||
}
|
}
|
||||||
|
|
||||||
start.store(1);
|
start.store(1);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
// Copyright 2023 Christian Mazakas.
|
// Copyright 2023 Christian Mazakas.
|
||||||
// Copyright 2023 Joaquin M Lopez Munoz.
|
// Copyright 2023-2024 Joaquin M Lopez Munoz.
|
||||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
@ -28,8 +28,8 @@ int main() {}
|
|||||||
#include <boost/interprocess/containers/string.hpp>
|
#include <boost/interprocess/containers/string.hpp>
|
||||||
#include <boost/interprocess/managed_shared_memory.hpp>
|
#include <boost/interprocess/managed_shared_memory.hpp>
|
||||||
|
|
||||||
#include <boost/process/child.hpp>
|
#include <boost/asio.hpp>
|
||||||
#include <boost/process/filesystem.hpp>
|
#include <boost/process/process.hpp>
|
||||||
|
|
||||||
#include <boost/uuid/random_generator.hpp>
|
#include <boost/uuid/random_generator.hpp>
|
||||||
#include <boost/uuid/uuid_io.hpp>
|
#include <boost/uuid/uuid_io.hpp>
|
||||||
@ -141,7 +141,8 @@ parent(std::string const& shm_name_, char const* exe_name, C*)
|
|||||||
|
|
||||||
BOOST_TEST(c->empty());
|
BOOST_TEST(c->empty());
|
||||||
|
|
||||||
boost::process::child child(exe_name, shm_name);
|
boost::asio::io_context ctx;
|
||||||
|
boost::process::process child(ctx.get_executor(), exe_name, {shm_name});
|
||||||
child.wait();
|
child.wait();
|
||||||
int ret = child.exit_code();
|
int ret = child.exit_code();
|
||||||
|
|
||||||
@ -240,7 +241,8 @@ parent(std::string const& shm_name_, char const* exe_name, C*)
|
|||||||
|
|
||||||
BOOST_TEST(c->empty());
|
BOOST_TEST(c->empty());
|
||||||
|
|
||||||
boost::process::child child(exe_name, shm_name);
|
boost::asio::io_context ctx;
|
||||||
|
boost::process::process child(ctx.get_executor(), exe_name, {shm_name});
|
||||||
child.wait();
|
child.wait();
|
||||||
int ret = child.exit_code();
|
int ret = child.exit_code();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user