zircon/system/ulib/async-loop/test/loop_tests.cc
// The goal here is to ensure that threads stop when Shutdown() is called.
The goal here is to ensure that threads stop when Shutdown() is called.
The goal here is to ensure that threads stop when Shutdown () is called .
TEST(Loop, ThroadsShutdown) {
  for (int i = 0; i < 3; i++) {
    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.Shutdown();
    EXPECT_EQ(ASYNC_LOOP_SHUTDOWN, loop.GetState());
    loop.JoinThreads();  
    EXPECT_EQ(ZX_ERR_BAD_STATE, loop.StartThread(), "can't start threads after shutdown");
  }
}
TEST ( Loop , ThroadsShutdown ) { for ( int i = 0 ; i < 3 ; i ++ ) { 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 . Shutdown ( ) ; EXPECT_EQ ( ASYNC_LOOP_SHUTDOWN , loop . GetState ( ) ) ; loop . JoinThreads ( ) ; EXPECT_EQ ( ZX_ERR_BAD_STATE , loop . StartThread ( ) , " " ) ; } }
The goal here is to ensure that threads stop when Shutdown() is called.
The goal here is to ensure that threads stop when Shutdown () is called .
// should be a no-op