openscenegraph
Barrier
Go to the documentation of this file.
1/* -*-c++-*- OpenThreads library, Copyright (C) 2002 - 2007 The Open Thread Group
2 *
3 * This library is open source and may be redistributed and/or modified under
4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5 * (at your option) any later version. The full license is in LICENSE file
6 * included with this distribution, and on the openscenegraph.org website.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * OpenSceneGraph Public License for more details.
12*/
13
14
15//
16// Barrier - C++ barrier class
17// ~~~~~~~
18//
19
20#ifndef _OPENTHREADS_BARRIER_
21#define _OPENTHREADS_BARRIER_
22
23#include <OpenThreads/Exports>
24
25namespace OpenThreads {
26
27
38
39public:
40
44 Barrier(int numThreads=0);
45
49 virtual ~Barrier();
50
54 virtual void reset();
55
59 virtual void block(unsigned int numThreads=0);
60
64 virtual void release();
65
71
72
73 void invalidate();
74
75private:
76
80 Barrier(const Barrier &/*b*/) {};
81
85 Barrier &operator=(const Barrier &/*b*/) {return *(this);};
86
90 void *_prvData;
91
92
93 bool _valid;
94
95};
96
97}
98
99#endif // !_OPENTHREADS_BARRIER_
100
#define OPENTHREAD_EXPORT_DIRECTIVE
Definition Exports:20
This class provides an object-oriented thread barrier interface.
Definition Barrier:37
virtual void block(unsigned int numThreads=0)
virtual void release()
virtual void reset()
Barrier(int numThreads=0)
virtual int numThreadsCurrentlyBlocked()
Definition Affinity:26