mirror of
https://github.com/boostorg/interprocess.git
synced 2026-01-25 06:12:25 +00:00
18 lines
414 B
C++
18 lines
414 B
C++
#include <boost/interprocess/sync/interprocess_semaphore.hpp>
|
|
|
|
struct shared_memory_buffer
|
|
{
|
|
enum { NumItems = 10 };
|
|
|
|
shared_memory_buffer()
|
|
: mutex(1), nempty(NumItems), nstored(0)
|
|
{}
|
|
|
|
//Semaphores to protect and synchronize access
|
|
boost::interprocess::interprocess_semaphore
|
|
mutex, nempty, nstored;
|
|
|
|
//Items to fill
|
|
int items[NumItems];
|
|
};
|