Changes for Boost.1.39

[SVN r51964]
This commit is contained in:
Ion Gaztañaga
2009-03-24 21:52:06 +00:00
parent 814c51a803
commit 3d0fcd68e3
274 changed files with 23335 additions and 20691 deletions

View File

@@ -31,8 +31,13 @@ typedef shared_ptr<MyType, void_allocator_type, deleter_type> my_shared_ptr;
int main ()
{
//Destroy any previous segment with the name to be used.
shared_memory_object::remove("MySharedMemory");
//Remove shared memory on construction and destruction
struct shm_destroy
{
shm_destroy() { shared_memory_object::remove("MySharedMemory"); }
~shm_destroy(){ shared_memory_object::remove("MySharedMemory"); }
} remover;
managed_shared_memory segment(create_only, "MySharedMemory", 4096);
//Create a shared pointer in shared memory
@@ -49,7 +54,6 @@ int main ()
//Destroy "shared ptr". "object to share" will be automatically destroyed
segment.destroy_ptr(&shared_ptr_instance);
shared_memory_object::remove("MySharedMemory");
return 0;
}
//]