1 //////////////////////////////////////////////////////////////////////////////
3 // (C) Copyright Ion Gaztanaga 2006-2009. Distributed under the Boost
4 // Software License, Version 1.0. (See accompanying file
5 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 // See http://www.boost.org/libs/interprocess for documentation.
9 //////////////////////////////////////////////////////////////////////////////
10 //[doc_anonymous_semaphore_shared_data
11 #include <boost/interprocess/sync/interprocess_semaphore.hpp>
13 struct shared_memory_buffer
15 enum { NumItems = 10 };
17 shared_memory_buffer()
18 : mutex(1), nempty(NumItems), nstored(0)
21 //Semaphores to protect and synchronize access
22 boost::interprocess::interprocess_semaphore
23 mutex, nempty, nstored;