RaftLib  0.3a
C++ Stream Processing Template Library
blocked.hpp
1 
20 #ifndef _BLOCKED_HPP_
21 #define _BLOCKED_HPP_ 1
22 #include <cstdint>
23 
24 union Blocked
25 {
26 
27  Blocked() : all( 0 )
28  {}
29 
30  Blocked( volatile Blocked &other )
31  {
32  count = other.count;
33  blocked = other.blocked;
34  }
35 
36  Blocked& operator += ( const Blocked &rhs )
37  {
38  if( ! rhs.blocked )
39  {
40  (this)->count += rhs.count;
41  }
42  return( *this );
43  }
44 
45  struct
46  {
47  std::uint32_t blocked;
48  std::uint32_t count;
49  };
50  std::uint64_t all;
51 } __attribute__ ((aligned( 8 )));
52 
53 #endif /* END _BLOCKED_HPP_ */
Definition: blocked.hpp:24