[Lldb-commits] [lldb] 65596ce - [lldb] Go back to process-directed signals in MainLoopTest.cpp
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Tue Sep 6 05:07:51 PDT 2022
Author: Pavel Labath
Date: 2022-09-06T14:00:53+02:00
New Revision: 65596cede8a4bcb8532b37702aa2b42270d4315c
URL: https://github.com/llvm/llvm-project/commit/65596cede8a4bcb8532b37702aa2b42270d4315c
DIFF: https://github.com/llvm/llvm-project/commit/65596cede8a4bcb8532b37702aa2b42270d4315c.diff
LOG: [lldb] Go back to process-directed signals in MainLoopTest.cpp
Thread-directed signals are not caught by kqueue (used on Mac). This
reverts half of D133181.
Added:
Modified:
lldb/unittests/Host/MainLoopTest.cpp
Removed:
################################################################################
diff --git a/lldb/unittests/Host/MainLoopTest.cpp b/lldb/unittests/Host/MainLoopTest.cpp
index 5ebe009e5cd6..00e85514463f 100644
--- a/lldb/unittests/Host/MainLoopTest.cpp
+++ b/lldb/unittests/Host/MainLoopTest.cpp
@@ -197,7 +197,7 @@ TEST_F(MainLoopTest, Signal) {
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);
}
@@ -215,8 +215,8 @@ TEST_F(MainLoopTest, UnmonitoredSignal) {
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);
}
@@ -238,7 +238,7 @@ TEST_F(MainLoopTest, TwoSignalCallbacks) {
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);
@@ -251,7 +251,7 @@ TEST_F(MainLoopTest, TwoSignalCallbacks) {
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);
@@ -259,7 +259,7 @@ TEST_F(MainLoopTest, TwoSignalCallbacks) {
}
// 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);
More information about the lldb-commits
mailing list