auto handle = loop.RegisterSignal(SIGUSR1, make_callback(), error);
ASSERT_TRUE(error.Success());
- pthread_kill(pthread_self(), SIGUSR1);
+ kill(getpid(), SIGUSR1);
ASSERT_TRUE(loop.Run().Success());
ASSERT_EQ(1u, callback_count);
}
auto handle = loop.RegisterSignal(SIGUSR1, make_callback(), error);
ASSERT_TRUE(error.Success());
- pthread_kill(pthread_self(), SIGUSR2);
- pthread_kill(pthread_self(), SIGUSR1);
+ kill(getpid(), SIGUSR2);
+ kill(getpid(), SIGUSR1);
ASSERT_TRUE(loop.Run().Success());
ASSERT_EQ(1u, callback_count);
}
SIGUSR1, [&](MainLoopBase &loop) { ++callback2_count; }, error);
ASSERT_TRUE(error.Success());
- pthread_kill(pthread_self(), SIGUSR1);
+ kill(getpid(), SIGUSR1);
ASSERT_TRUE(loop.Run().Success());
ASSERT_EQ(1u, callback_count);
ASSERT_EQ(1u, callback2_count);
SIGUSR1, [&](MainLoopBase &loop) { ++callback3_count; }, error);
ASSERT_TRUE(error.Success());
- pthread_kill(pthread_self(), SIGUSR1);
+ kill(getpid(), SIGUSR1);
ASSERT_TRUE(loop.Run().Success());
ASSERT_EQ(2u, callback_count);
ASSERT_EQ(1u, callback2_count);
}
// Both extra callbacks should be unregistered now.
- pthread_kill(pthread_self(), SIGUSR1);
+ kill(getpid(), SIGUSR1);
ASSERT_TRUE(loop.Run().Success());
ASSERT_EQ(3u, callback_count);
ASSERT_EQ(1u, callback2_count);