zircon/system/ulib/async-loop/test/loop_tests.cc
// The goal here is to ensure that threads stop when Quit() is called.
The goal here is to ensure that threads stop when Quit() is called.
The goal here is to ensure that threads stop when Quit () is called .
TEST(Loop, ThreadsQuit) {
  const size_t num_threads = 4;
  async::Loop loop(&kAsyncLoopConfigNoAttachToCurrentThread);
  for (size_t i = 0; i < num_threads; i++) {
    EXPECT_EQ(ZX_OK, loop.StartThread());
  }
  loop.Quit();
  loop.JoinThreads();
  EXPECT_EQ(ASYNC_LOOP_QUIT, loop.GetState());
}
TEST ( Loop , ThreadsQuit ) { const size_t num_threads = 4 ; async :: Loop loop ( & kAsyncLoopConfigNoAttachToCurrentThread ) ; for ( size_t i = 0 ; i < num_threads ; i ++ ) { EXPECT_EQ ( ZX_OK , loop . StartThread ( ) ) ; } loop . Quit ( ) ; loop . JoinThreads ( ) ; EXPECT_EQ ( ASYNC_LOOP_QUIT , loop . GetState ( ) ) ; }
The goal here is to ensure that threads stop when Quit() is called.
The goal here is to ensure that threads stop when Quit () is called .