2
0
mirror of https://github.com/boostorg/fiber.git synced 2026-02-20 14:42:21 +00:00

C++14 - barrier

This commit is contained in:
Oliver Kowalke
2015-12-02 17:18:07 +01:00
parent 4157d2dc5d
commit f225548427
2 changed files with 4 additions and 4 deletions

View File

@@ -18,8 +18,8 @@ namespace boost {
namespace fibers {
barrier::barrier( std::size_t initial) :
initial_( initial),
current_( initial_) {
initial_{ initial },
current_{ initial_ } {
if ( 0 == initial) {
throw invalid_argument( static_cast< int >( std::errc::invalid_argument),
"boost fiber: zero initial barrier count");
@@ -29,7 +29,7 @@ barrier::barrier( std::size_t initial) :
bool
barrier::wait() {
std::unique_lock< mutex > lk( mtx_);
const bool cycle( cycle_);
const bool cycle = cycle_;
if ( 0 == --current_) {
cycle_ = ! cycle_;
current_ = initial_;