Fawkes API
Fawkes Development Version
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
All
Classes
Namespaces
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Groups
Pages
interruptible_barrier.h
1
2
/***************************************************************************
3
* interruptible_barrier.h - Interruptible Barrier
4
*
5
* Created: Sat Jan 31 12:27:54 2009
6
* Copyright 2006-2009 Tim Niemueller [www.niemueller.de]
7
*
8
****************************************************************************/
9
10
/* This program is free software; you can redistribute it and/or modify
11
* it under the terms of the GNU General Public License as published by
12
* the Free Software Foundation; either version 2 of the License, or
13
* (at your option) any later version. A runtime exception applies to
14
* this software (see LICENSE.GPL_WRE file mentioned below for details).
15
*
16
* This program is distributed in the hope that it will be useful,
17
* but WITHOUT ANY WARRANTY; without even the implied warranty of
18
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
* GNU Library General Public License for more details.
20
*
21
* Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22
*/
23
24
#ifndef __CORE_THREADING_INTERRUPTIBLE_BARRIER_H_
25
#define __CORE_THREADING_INTERRUPTIBLE_BARRIER_H_
26
27
#include <core/threading/barrier.h>
28
#include <core/utils/refptr.h>
29
30
namespace
fawkes {
31
#if 0
/* just to make Emacs auto-indent happy */
32
}
33
#endif
34
35
class
InterruptibleBarrierData;
36
class
ThreadList;
37
38
class
InterruptibleBarrier
:
public
Barrier
39
{
40
public
:
41
InterruptibleBarrier
(
unsigned
int
count);
42
InterruptibleBarrier
(
Mutex
*mutex,
unsigned
int
count);
43
virtual
~
InterruptibleBarrier
();
44
45
bool
wait(
unsigned
int
timeout_sec,
unsigned
int
timeout_nanosec);
46
virtual
inline
void
wait
() {
wait
(0, 0); }
47
48
void
interrupt() throw();
49
void
reset() throw();
50
51
RefPtr
<
ThreadList
> passed_threads();
52
53
private:
54
InterruptibleBarrier
(const
InterruptibleBarrier
&b);
55
InterruptibleBarrier
(const
InterruptibleBarrier
*b);
56
InterruptibleBarrier
& operator=(const
InterruptibleBarrier
&b);
57
InterruptibleBarrier
& operator=(const
InterruptibleBarrier
*b);
58
59
private:
60
InterruptibleBarrierData *__data;
61
RefPtr
<
ThreadList
> __passed_threads;
62
63
bool
__interrupted;
64
bool
__timeout;
65
bool
__wait_at_barrier;
66
};
67
68
69
}
// end namespace fawkes
70
71
#endif
src
libs
core
threading
interruptible_barrier.h
Generated by
1.8.3.1