This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git
The following commit(s) were added to refs/heads/master by this push:
new a011cad58 testing/ostest/signest: Replace kill with pthread_kill to
fix running in SMP
a011cad58 is described below
commit a011cad584411c64083c3db033334d0eca156e12
Author: Jukka Laitinen <[email protected]>
AuthorDate: Fri May 2 08:03:29 2025 +0300
testing/ostest/signest: Replace kill with pthread_kill to fix running in SMP
"kill" sends the signal to all the the threads in the group. The intention
of
the test is to send signals only to the "waiter" thread.
Running signal actions in parallel is not compatible behaviour with
the signest test, which assumes that signals are being run one after
another.
For example running signals 38 and 40 in parallel on two threads/two cpus
would cause the test incorrectly fail on "even signals nested".
Signed-off-by: Jukka Laitinen <[email protected]>
---
testing/ostest/signest.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/testing/ostest/signest.c b/testing/ostest/signest.c
index 7b0378849..1e82e8ea6 100644
--- a/testing/ostest/signest.c
+++ b/testing/ostest/signest.c
@@ -328,13 +328,13 @@ void signest_test(void)
{
if (signest_catchable(j))
{
- kill(waiterpid, j);
+ pthread_kill(waiterpid, j);
odd_signals++;
}
if (signest_catchable(j + 1))
{
- kill(waiterpid, j + 1);
+ pthread_kill(waiterpid, j + 1);
even_signals++;
}
@@ -344,13 +344,13 @@ void signest_test(void)
if (signest_catchable(j + 1))
{
- kill(waiterpid, j + 1);
+ pthread_kill(waiterpid, j + 1);
even_signals++;
}
if (signest_catchable(j))
{
- kill(waiterpid, j);
+ pthread_kill(waiterpid, j);
odd_signals++;
}
@@ -387,13 +387,13 @@ void signest_test(void)
if (signest_catchable(j))
{
- kill(waiterpid, j);
+ pthread_kill(waiterpid, j);
odd_signals++;
}
if (signest_catchable(j + 1))
{
- kill(waiterpid, j + 1);
+ pthread_kill(waiterpid, j + 1);
even_signals++;
}
@@ -407,13 +407,13 @@ void signest_test(void)
if (signest_catchable(j + 1))
{
- kill(waiterpid, j + 1);
+ pthread_kill(waiterpid, j + 1);
even_signals++;
}
if (signest_catchable(j))
{
- kill(waiterpid, j);
+ pthread_kill(waiterpid, j);
odd_signals++;
}
@@ -449,7 +449,7 @@ void signest_test(void)
if (signest_catchable(j))
{
- kill(waiterpid, j);
+ pthread_kill(waiterpid, j);
odd_signals++;
}
@@ -457,7 +457,7 @@ void signest_test(void)
if (signest_catchable(j + 1))
{
- kill(waiterpid, j + 1);
+ pthread_kill(waiterpid, j + 1);
even_signals++;
}
@@ -470,7 +470,7 @@ void signest_test(void)
sched_lock();
if (signest_catchable(j + 1))
{
- kill(waiterpid, j + 1);
+ pthread_kill(waiterpid, j + 1);
even_signals++;
}
@@ -478,7 +478,7 @@ void signest_test(void)
if (signest_catchable(j))
{
- kill(waiterpid, j);
+ pthread_kill(waiterpid, j);
odd_signals++;
}