#1211: Interprocess tests hang when run in parallel

#1080 boost::interprocess win32 global file mapping issue 

[SVN r38951]
This commit is contained in:
Ion Gaztañaga
2007-08-25 19:10:12 +00:00
parent 3a18bed072
commit 9915fc41ab
24 changed files with 308 additions and 220 deletions

View File

@@ -17,23 +17,23 @@
#include <boost/interprocess/windows_shared_memory.hpp>
#include <boost/interprocess/mapped_region.hpp>
#include <string>
#include "get_compiler_name.hpp"
#include "get_process_id_name.hpp"
using namespace boost::interprocess;
int main ()
{
std::string compiler_name;
test::get_compiler_name(compiler_name);
std::string process_name;
test::get_process_id_name(process_name);
try{
const std::size_t FileSize = 99999*2;
//Create shared memory and file mapping
windows_shared_memory mapping(create_only, compiler_name.c_str(), read_write, FileSize);
windows_shared_memory mapping(create_only, process_name.c_str(), read_write, FileSize);
{
//Create a file mapping
windows_shared_memory mapping(open_only, compiler_name.c_str(), read_write);
windows_shared_memory mapping(open_only, process_name.c_str(), read_write);
//Create two mapped regions, one half of the file each
mapped_region region (mapping
@@ -67,7 +67,7 @@ int main ()
//See if the pattern is correct in the file using two mapped regions
{
//Create a file mapping
windows_shared_memory mapping(open_only, compiler_name.c_str(), read_write);
windows_shared_memory mapping(open_only, process_name.c_str(), read_write);
mapped_region region(mapping, read_write, 0, FileSize/2, 0);
mapped_region region2(mapping, read_write, FileSize/2, 0/*FileSize - FileSize/2*/, 0);
@@ -97,7 +97,7 @@ int main ()
//Now check the pattern mapping a single read only mapped_region
{
//Create a file mapping
windows_shared_memory mapping(open_only, compiler_name.c_str(), read_only);
windows_shared_memory mapping(open_only, process_name.c_str(), read_only);
//Create a single regions, mapping all the file
mapped_region region (mapping