cc857508adaaf7af12f38d4f4ebb437bbe4798cb
[platform/upstream/boost.git] / libs / interprocess / example / doc_upgradable_mutex_shared_data.hpp
1 //////////////////////////////////////////////////////////////////////////////
2 //
3 // (C) Copyright Ion Gaztanaga 2006-2011. 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)
6 //
7 // See http://www.boost.org/libs/interprocess for documentation.
8 //
9 //////////////////////////////////////////////////////////////////////////////
10    #include <boost/interprocess/sync/interprocess_upgradable_mutex.hpp>
11
12    struct shared_data
13    {
14       enum { NumItems = 100 };
15       enum { LineSize = 100 };
16
17       shared_data()
18          :  current_line(0)
19          ,  end_a(false)
20          ,  end_b(false)
21       {}
22
23       //Mutex to protect access to the queue
24       boost::interprocess::interprocess_upgradable_mutex upgradable_mutex;
25
26       //Items to fill
27       char   items[NumItems][LineSize];
28       int    current_line;
29       bool   end_a;
30       bool   end_b;
31    };