static BarrierPtr create(unsigned int expected_actors);
/** Blocks into the barrier. Every waiting actors will be unlocked once the expected amount of actors reaches the barrier */
int wait();
+ /** Returns some debug information about the barrier */
+ std::string to_string();
#ifndef DOXYGEN
/* refcounting */
}
s4u::Barrier& get_iface() { return piface_; }
+
+ std::string to_string()
+ {
+ return xbt::string_printf("Barrier %d: %zu of %u", id_, ongoing_acquisitions_.size(), expected_actors_);
+ }
};
} // namespace activity
} // namespace kernel
}
}
+std::string Barrier::to_string()
+{
+ return pimpl_->to_string();
+}
+
void intrusive_ptr_add_ref(Barrier* barrier)
{
intrusive_ptr_add_ref(barrier->pimpl_);