Pie*_*tro 1 c++ boost semaphore interprocess
我会在共享内存中保留一些数据,使用命名信号量来管理访问:
#include <boost/interprocess/sync/named_semaphore.hpp>
struct shared_memory_buffer
{
// Application data
int items[10];
// Synchronization data
boost::interprocess::named_semaphore syncSem;
shared_memory_buffer()
: syncSem(boost::interprocess::open_or_create_t, "testSemaphore", 0) // error
{}
};
Run Code Online (Sandbox Code Playgroud)
但是,我在指定的行得到以下编译时错误:
error: expected primary-expression before ‘,’ token
Run Code Online (Sandbox Code Playgroud)
这是我的系统:
MacOS X 10.6
i686-apple-darwin10-g ++ - 4.2.1(GCC)4.2.1(Apple Inc. build 5664)
提升1.44
谢谢!
| 归档时间: |
|
| 查看次数: |
825 次 |
| 最近记录: |