-
Notifications
You must be signed in to change notification settings - Fork 674
signals: fix dependency issues when signals are all disabled #3333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
e1cf0b0 to
0625200
Compare
0625200 to
cf6a657
Compare
testing/ostest/Makefile
Outdated
| CSRCS += suspend.c | ||
| endif | ||
| endif | ||
| endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move before line 49
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
| list(APPEND SRCS suspend.c) | ||
| endif() | ||
| endif() | ||
| endif() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move before line 7 and revert the change from lin3 37-40
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
| /* Wait for receiver thread to terminate */ | ||
|
|
||
| #ifndef CONFIG_DISABLE_ALL_SIGNALS | ||
| pthread_kill(fwd.if_receiver, 9); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need pthread_cancel to make receiver exit? please reference the change in previous pr.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
| for (tidx = 0; tidx < nthreads; tidx++) | ||
| { | ||
| #ifndef CONFIG_DISABLE_ALL_SIGNALS | ||
| pthread_kill(tid[tidx], SIGUSR1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
| i8sak->eventlistener_run = false; | ||
|
|
||
| #ifndef CONFIG_DISABLE_ALL_SIGNALS | ||
| pthread_kill(i8sak->eventlistener_threadid, 2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
cf6a657 to
e3804fa
Compare
| #ifndef CONFIG_DISABLE_ALL_SIGNALS | ||
| pthread_kill(fwd.if_receiver, 9); | ||
| #else | ||
| pthread_cancel(fwd.if_receiver); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean update it like this? (use #ifdef CONFIG_ENABLE_ALL_SIGNALS):
#ifdef CONFIG_ENABLE_ALL_SIGNALS
pthread_kill(fwd.if_receiver, 9);
#else
pthread_cancel(fwd.if_receiver);
#endif
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
something like this:
#ifndef CONFIG_ENABLE_ALL_SIGNALS
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, NULL);
#endif
while (1)
{
#ifndef CONFIG_ENABLE_ALL_SIGNALS
pthread_testcancel();
#endif
af94348 to
0cc5a9a
Compare
|
|
||
| i8sak->eventlistener_run = false; | ||
|
|
||
| #ifdef CONFIG_ENABLE_ALL_SIGNALS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| #ifdef CONFIG_ENABLE_ALL_SIGNALS | |
| #ifdef CONFIG_DISABLE_ALL_SIGNALS | |
| pthread_cancel(i8sak->eventlistener_threadid); | |
| #else | |
| pthread_kill(i8sak->eventlistener_threadid, 2); | |
| #endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
| FAR struct ieee802154_primitive_s *primitive = NULL; | ||
| int ret = OK; | ||
|
|
||
| #ifndef CONFIG_ENABLE_ALL_SIGNALS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| #ifndef CONFIG_ENABLE_ALL_SIGNALS | |
| #ifdef CONFIG_DISABLE_ALL_SIGNALS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
testing/ostest/mqueue.c
Outdated
|
|
||
| /* Wake up the receiver thread with a signal */ | ||
|
|
||
| #ifdef CONFIG_ENABLE_ALL_SIGNALS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| #ifdef CONFIG_ENABLE_ALL_SIGNALS | |
| #ifndef CONFIG_DISABLE_ALL_SIGNALS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
|
||
| while (i8sak->eventlistener_run) | ||
| { | ||
| #ifndef CONFIG_ENABLE_ALL_SIGNALS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| #ifndef CONFIG_ENABLE_ALL_SIGNALS | |
| #ifdef CONFIG_DISABLE_ALL_SIGNALS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
|
||
| #ifdef CONFIG_ENABLE_ALL_SIGNALS | ||
| printf("mqueue_test: Killing receiver\n"); | ||
| pthread_kill(receiver, SIGUSR1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we skip the test from build
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, I removed the test from build.
system/sensortest/sensortest.c
Outdated
| return -EINVAL; | ||
| } | ||
|
|
||
| #ifdef CONFIG_ENABLE_ALL_SIGNALS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should skip the test in this case or modify the code to make it work really
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I chose to remove the test from build.
|
|
||
| for (tidx = 0; tidx < nthreads; tidx++) | ||
| { | ||
| #ifdef CONFIG_ENABLE_ALL_SIGNALS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| #ifdef CONFIG_ENABLE_ALL_SIGNALS | |
| #ifdef CONFIG_DISABLE_ALL_SIGNALS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
| TEST_ASSERT_TRUE(test_abort); | ||
| TEST_ASSERT_TRUE(test_hang || !test_hang); | ||
|
|
||
| #ifndef CONFIG_ENABLE_ALL_SIGNALS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
66096e1 to
62f6066
Compare
Fix build and runtime issues when signals all disabled. Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
62f6066 to
8610764
Compare
Fix build and runtime issues when signals all disabled.
Summary
This PR fixes dependency issues when signals are all disabled
Impact
Fix dependency issues when signals are all disabled, no impact to any existing functions
Testing
ostest passed on rv-virt:smp64
disable all signals
ostest passed log