I'm trying to run the following program, which works under Linux, on an
intel
mac:
#include
#include
#include
#include <iostream>
using namespace std;
namespace bi = boost::interprocess;
int main( int argc, char **argv )
{
cout << "Creating mutex" << endl;
try
{
bi::named_mutex directoryMutex( bi::create_only,
"MyVeryUniquelyNamedMutex" );
cout << "Creating scoped lock" << endl;
bi::scoped_lockbi::named_mutex lock( directoryMutex );
cout << "All reqs met. Destroying mutex" << endl;
bi::named_mutex::remove( "MyVeryUniquelyNamedMutex" );
}
catch( std::exception &e )
{
cout << "Problem encountered: " << e.what() << endl;
}
return 0;
}
I'm using a combination of the boost CVS for the interprocess header
files and
everything else from 1.33.1. The interprocess headers are current as of
Mar 7.
I've also tried open_or_create, and get the same result.
On linux, this seems to work fine, with output:
$ ./test
Creating mutex
Unlocking mutex
Creating scoped lock
All reqs met. Destroying mutex
$
On the mac, it outputs:
$ ./test
Creating mutex
Problem encountered:
$
$ uname -a
[...] 8.8.1 Darwin Kernel Version 8.8.1: Mon Sep 25 19:42:00 PDT 2006;
root:xnu-792.13.8.obj~1/RELEASE_I386 i386 i386
$ g++ -dumpversion
4.0.1
$ g++ -dumpmachine
i686-apple-darwin8