17#include <gtest/gtest.h> 
   22TEST(Example, Strand) {
 
   23  std::cout << 
"Strand" << std::endl;
 
   29  std::size_t counter = 0;
 
   31  static constexpr std::size_t kThreads = 5;
 
   32  static constexpr std::size_t kIncrementsPerThread = 12345;
 
   34  std::vector<yaclib_std::thread> threads;
 
   36  for (std::size_t i = 0; i < kThreads; ++i) {
 
   37    threads.emplace_back([&]() {
 
   38      for (std::size_t j = 0; j < kIncrementsPerThread; ++j) {
 
   46  for (
auto& t : threads) {
 
   53  std::cout << 
"Counter value = " << counter << 
", expected " << kThreads * kIncrementsPerThread << std::endl;
 
   55  std::cout << std::endl;
 
TODO(kononovk) Doxygen docs.
void Submit(IExecutor &executor, Func &&f)
Submit given func for details.
IExecutorPtr MakeStrand(IExecutorPtr e)
Strand is the asynchronous analogue of a mutex.
TEST(Example, HelloWorld)