mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-01 20:29:00 +00:00
signals: fix build and runtime issues when signals all isabled
Fix build and runtime issues when signals all disabled. Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
This commit is contained in:
parent
9c85568c4f
commit
d9afe2db8c
19 changed files with 172 additions and 48 deletions
|
|
@ -6,7 +6,7 @@
|
|||
config CANUTILS_CANDUMP
|
||||
tristate "SocketCAN candump tool"
|
||||
default n
|
||||
depends on NET_CAN && CANUTILS_LIBCANUTILS
|
||||
depends on NET_CAN && CANUTILS_LIBCANUTILS && ENABLE_ALL_SIGNALS
|
||||
---help---
|
||||
Enable the SocketCAN candump tool ported from
|
||||
https://github.com/linux-can/can-utils
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
config EXAMPLES_CHRONO
|
||||
tristate "Chronometer example to use with STM32LDiscover"
|
||||
default n
|
||||
depends on SLCD
|
||||
depends on SLCD && ENABLE_ALL_SIGNALS
|
||||
---help---
|
||||
Enable the Chronometer example
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
config EXAMPLES_DJOYSTICK
|
||||
tristate "Discrete joystick example"
|
||||
default n
|
||||
depends on INPUT_DJOYSTICK
|
||||
depends on INPUT_DJOYSTICK && ENABLE_ALL_SIGNALS
|
||||
---help---
|
||||
Enable the discrete joystick example
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,6 @@
|
|||
config EXAMPLES_I2SLOOP
|
||||
tristate "I2S loopback test"
|
||||
default n
|
||||
depends on I2S && AUDIO && DRIVERS_AUDIO && AUDIO_I2SCHAR
|
||||
depends on I2S && AUDIO && DRIVERS_AUDIO && AUDIO_I2SCHAR && ENABLE_ALL_SIGNALS
|
||||
---help---
|
||||
Enable the I2S loopback test
|
||||
|
|
|
|||
|
|
@ -542,8 +542,16 @@ static FAR void *ipfwd_receiver(FAR void *arg)
|
|||
int errcode;
|
||||
int i;
|
||||
|
||||
#ifdef CONFIG_DISABLE_ALL_SIGNALS
|
||||
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
|
||||
pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, NULL);
|
||||
#endif
|
||||
|
||||
for (i = 0; i < IPFWD_NPACKETS; i++)
|
||||
{
|
||||
#ifdef CONFIG_DISABLE_ALL_SIGNALS
|
||||
pthread_testcancel();
|
||||
#endif
|
||||
nread = read(fwd->ia_fd, fwd->ia_buffer, IPFWD_BUFSIZE);
|
||||
if (nread < 0)
|
||||
{
|
||||
|
|
@ -840,7 +848,12 @@ errout_with_receiver:
|
|||
|
||||
/* Wait for receiver thread to terminate */
|
||||
|
||||
#ifdef CONFIG_DISABLE_ALL_SIGNALS
|
||||
pthread_cancel(fwd.if_receiver);
|
||||
#else
|
||||
pthread_kill(fwd.if_receiver, 9);
|
||||
#endif
|
||||
|
||||
ret = pthread_join(fwd.if_receiver, &value);
|
||||
if (ret != OK)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
config EXAMPLES_ONESHOT
|
||||
tristate "Oneshot timer example"
|
||||
default n
|
||||
depends on ONESHOT
|
||||
depends on ONESHOT && ENABLE_ALL_SIGNALS
|
||||
---help---
|
||||
Enable the oneshot timer driver example
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
menuconfig EXAMPLES_SHV_NXBOOT_UPDATER
|
||||
bool "Silicon Heaven Firmware updates for NXBoot"
|
||||
depends on NETUTILS_LIBSHVC
|
||||
depends on NETUTILS_LIBSHVC && ENABLE_ALL_SIGNALS
|
||||
default n
|
||||
---help---
|
||||
Enable the shv-nxboot-updater application.
|
||||
|
|
|
|||
|
|
@ -146,11 +146,20 @@ static void do_usrsock_blocking_socket_thread(FAR void *param)
|
|||
TEST_ASSERT_TRUE(test_hang);
|
||||
TEST_ASSERT_TRUE(test_abort);
|
||||
|
||||
#ifdef CONFIG_DISABLE_ALL_SIGNALS
|
||||
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
|
||||
pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, NULL);
|
||||
#endif
|
||||
|
||||
/* Allow main thread to hang usrsock daemon at this point. */
|
||||
|
||||
sem_post(&tid_startsem);
|
||||
sem_wait(&tid_releasesem);
|
||||
|
||||
#ifdef CONFIG_DISABLE_ALL_SIGNALS
|
||||
pthread_testcancel();
|
||||
#endif
|
||||
|
||||
/* Attempt hanging open socket. */
|
||||
|
||||
sem_post(&tid_startsem);
|
||||
|
|
@ -176,6 +185,11 @@ static void do_usrsock_blocking_close_thread(FAR void *param)
|
|||
TEST_ASSERT_TRUE(test_hang);
|
||||
TEST_ASSERT_TRUE(test_abort);
|
||||
|
||||
#ifdef CONFIG_DISABLE_ALL_SIGNALS
|
||||
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
|
||||
pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, NULL);
|
||||
#endif
|
||||
|
||||
/* Open socket. */
|
||||
|
||||
test_sd[tidx] = socket(AF_INET, SOCK_STREAM, 0);
|
||||
|
|
@ -190,6 +204,10 @@ static void do_usrsock_blocking_close_thread(FAR void *param)
|
|||
sem_post(&tid_startsem);
|
||||
sem_wait(&tid_releasesem);
|
||||
|
||||
#ifdef CONFIG_DISABLE_ALL_SIGNALS
|
||||
pthread_testcancel();
|
||||
#endif
|
||||
|
||||
/* Attempt hanging close socket. */
|
||||
|
||||
sem_post(&tid_startsem);
|
||||
|
|
@ -214,6 +232,11 @@ static void do_usrsock_blocking_connect_thread(FAR void *param)
|
|||
|
||||
TEST_ASSERT_TRUE(test_hang || !test_hang);
|
||||
|
||||
#ifdef CONFIG_DISABLE_ALL_SIGNALS
|
||||
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
|
||||
pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, NULL);
|
||||
#endif
|
||||
|
||||
/* Open socket. */
|
||||
|
||||
test_sd[tidx] = socket(AF_INET, SOCK_STREAM, 0);
|
||||
|
|
@ -228,6 +251,10 @@ static void do_usrsock_blocking_connect_thread(FAR void *param)
|
|||
sem_post(&tid_startsem);
|
||||
sem_wait(&tid_releasesem);
|
||||
|
||||
#ifdef CONFIG_DISABLE_ALL_SIGNALS
|
||||
pthread_testcancel();
|
||||
#endif
|
||||
|
||||
/* Attempt blocking connect. */
|
||||
|
||||
sem_post(&tid_startsem);
|
||||
|
|
@ -257,6 +284,11 @@ static void do_usrsock_blocking_setsockopt_thread(FAR void *param)
|
|||
bool test_abort = !!(test_flags & TEST_FLAG_DAEMON_ABORT);
|
||||
bool test_hang = !!(test_flags & TEST_FLAG_PAUSE_USRSOCK_HANDLING);
|
||||
|
||||
#ifdef CONFIG_DISABLE_ALL_SIGNALS
|
||||
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
|
||||
pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, NULL);
|
||||
#endif
|
||||
|
||||
/* Open socket. */
|
||||
|
||||
test_sd[tidx] = socket(AF_INET, SOCK_STREAM, 0);
|
||||
|
|
@ -274,6 +306,10 @@ static void do_usrsock_blocking_setsockopt_thread(FAR void *param)
|
|||
sem_post(&tid_startsem);
|
||||
sem_wait(&tid_releasesem);
|
||||
|
||||
#ifdef CONFIG_DISABLE_ALL_SIGNALS
|
||||
pthread_testcancel();
|
||||
#endif
|
||||
|
||||
/* Attempt hanging setsockopt. */
|
||||
|
||||
sem_post(&tid_startsem);
|
||||
|
|
@ -304,6 +340,11 @@ static void do_usrsock_blocking_getsockopt_thread(FAR void *param)
|
|||
bool test_abort = !!(test_flags & TEST_FLAG_DAEMON_ABORT);
|
||||
bool test_hang = !!(test_flags & TEST_FLAG_PAUSE_USRSOCK_HANDLING);
|
||||
|
||||
#ifdef CONFIG_DISABLE_ALL_SIGNALS
|
||||
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
|
||||
pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, NULL);
|
||||
#endif
|
||||
|
||||
/* Open socket. */
|
||||
|
||||
test_sd[tidx] = socket(AF_INET, SOCK_STREAM, 0);
|
||||
|
|
@ -321,6 +362,10 @@ static void do_usrsock_blocking_getsockopt_thread(FAR void *param)
|
|||
sem_post(&tid_startsem);
|
||||
sem_wait(&tid_releasesem);
|
||||
|
||||
#ifdef CONFIG_DISABLE_ALL_SIGNALS
|
||||
pthread_testcancel();
|
||||
#endif
|
||||
|
||||
/* Attempt hanging getsockopt. */
|
||||
|
||||
sem_post(&tid_startsem);
|
||||
|
|
@ -352,6 +397,11 @@ static void do_usrsock_blocking_send_thread(FAR void *param)
|
|||
|
||||
TEST_ASSERT_TRUE(test_hang || !test_hang);
|
||||
|
||||
#ifdef CONFIG_DISABLE_ALL_SIGNALS
|
||||
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
|
||||
pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, NULL);
|
||||
#endif
|
||||
|
||||
/* Open socket. */
|
||||
|
||||
test_sd[tidx] = socket(AF_INET, SOCK_STREAM, 0);
|
||||
|
|
@ -372,6 +422,10 @@ static void do_usrsock_blocking_send_thread(FAR void *param)
|
|||
sem_post(&tid_startsem);
|
||||
sem_wait(&tid_releasesem);
|
||||
|
||||
#ifdef CONFIG_DISABLE_ALL_SIGNALS
|
||||
pthread_testcancel();
|
||||
#endif
|
||||
|
||||
/* Attempt blocking send. */
|
||||
|
||||
sem_post(&tid_startsem);
|
||||
|
|
@ -401,6 +455,11 @@ static void do_usrsock_blocking_recv_thread(FAR void *param)
|
|||
|
||||
TEST_ASSERT_TRUE(test_hang || !test_hang);
|
||||
|
||||
#ifdef CONFIG_DISABLE_ALL_SIGNALS
|
||||
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
|
||||
pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, NULL);
|
||||
#endif
|
||||
|
||||
/* Open socket. */
|
||||
|
||||
test_sd[tidx] = socket(AF_INET, SOCK_STREAM, 0);
|
||||
|
|
@ -421,6 +480,10 @@ static void do_usrsock_blocking_recv_thread(FAR void *param)
|
|||
sem_post(&tid_startsem);
|
||||
sem_wait(&tid_releasesem);
|
||||
|
||||
#ifdef CONFIG_DISABLE_ALL_SIGNALS
|
||||
pthread_testcancel();
|
||||
#endif
|
||||
|
||||
/* Attempt blocking recv. */
|
||||
|
||||
sem_post(&tid_startsem);
|
||||
|
|
@ -454,6 +517,11 @@ static void do_usrsock_blocking_poll_thread(FAR void *param)
|
|||
TEST_ASSERT_TRUE(test_abort);
|
||||
TEST_ASSERT_TRUE(test_hang || !test_hang);
|
||||
|
||||
#ifdef CONFIG_DISABLE_ALL_SIGNALS
|
||||
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
|
||||
pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, NULL);
|
||||
#endif
|
||||
|
||||
/* Open socket. */
|
||||
|
||||
test_sd[tidx] = socket(AF_INET, SOCK_STREAM, 0);
|
||||
|
|
@ -474,6 +542,10 @@ static void do_usrsock_blocking_poll_thread(FAR void *param)
|
|||
sem_post(&tid_startsem);
|
||||
sem_wait(&tid_releasesem);
|
||||
|
||||
#ifdef CONFIG_DISABLE_ALL_SIGNALS
|
||||
pthread_testcancel();
|
||||
#endif
|
||||
|
||||
/* Attempt poll. */
|
||||
|
||||
pfd.fd = test_sd[tidx];
|
||||
|
|
@ -560,8 +632,11 @@ static void do_wake_test(enum e_test_type type, int flags)
|
|||
|
||||
for (tidx = 0; tidx < nthreads; tidx++)
|
||||
{
|
||||
#ifdef CONFIG_DISABLE_ALL_SIGNALS
|
||||
pthread_cancel(tid[tidx]);
|
||||
#else
|
||||
pthread_kill(tid[tidx], SIGUSR1);
|
||||
|
||||
#endif
|
||||
/* Wait threads to complete work. */
|
||||
|
||||
ret = pthread_join(tid[tidx], NULL);
|
||||
|
|
|
|||
|
|
@ -5,11 +5,11 @@
|
|||
|
||||
config EXAMPLES_XEDGE_DEMO
|
||||
tristate "Xedge IoT Toolkit Demo"
|
||||
depends on NETUTILS_XEDGE && ALLOW_GPL_COMPONENTS
|
||||
depends on NETUTILS_XEDGE && ALLOW_GPL_COMPONENTS && ENABLE_ALL_SIGNALS
|
||||
default n
|
||||
---help---
|
||||
Simple demonstration of the Xedge IoT Toolkit library.
|
||||
|
||||
|
||||
This example shows how to integrate and use the Xedge library
|
||||
in your NuttX application. Xedge provides a high-level development
|
||||
environment for creating IoT and industrial device applications
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
config EXAMPLES_ZEROCROSS
|
||||
tristate "Zero Cross Detection example"
|
||||
default n
|
||||
depends on SENSORS_ZEROCROSS
|
||||
depends on SENSORS_ZEROCROSS && ENABLE_ALL_SIGNALS
|
||||
---help---
|
||||
Enable the zero cross detection example
|
||||
|
||||
|
|
|
|||
|
|
@ -1179,6 +1179,7 @@ int cmd_switchboot(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv);
|
|||
int cmd_unset(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv);
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_DISABLE_ALL_SIGNALS
|
||||
#ifndef CONFIG_NSH_DISABLE_KILL
|
||||
int cmd_kill(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv);
|
||||
#endif
|
||||
|
|
@ -1191,6 +1192,7 @@ int cmd_switchboot(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv);
|
|||
#ifndef CONFIG_NSH_DISABLE_USLEEP
|
||||
int cmd_usleep(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv);
|
||||
#endif
|
||||
#endif /* !CONFIG_DISABLE_ALL_SIGNALS */
|
||||
|
||||
#ifndef CONFIG_NSH_DISABLE_UPTIME
|
||||
int cmd_uptime(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv);
|
||||
|
|
|
|||
|
|
@ -304,14 +304,6 @@ static const struct cmdmap_s g_cmdmap[] =
|
|||
CMD_MAP("irqinfo", cmd_irqinfo, 1, 1, NULL),
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_NSH_DISABLE_KILL
|
||||
CMD_MAP("kill", cmd_kill, 2, 3, "[-<signal>] <pid>"),
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_FS_PROCFS) && !defined(CONFIG_NSH_DISABLE_PKILL)
|
||||
CMD_MAP("pkill", cmd_pkill, 2, 3, "[-<signal>] <name>"),
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_DISABLE_MOUNTPOINT
|
||||
# if defined(CONFIG_DEV_LOOP) && !defined(CONFIG_NSH_DISABLE_LOSETUP)
|
||||
CMD_MAP("losetup", cmd_losetup, 3, 6,
|
||||
|
|
@ -575,10 +567,24 @@ static const struct cmdmap_s g_cmdmap[] =
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_DISABLE_ALL_SIGNALS
|
||||
#ifndef CONFIG_NSH_DISABLE_KILL
|
||||
CMD_MAP("kill", cmd_kill, 2, 3, "[-<signal>] <pid>"),
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_FS_PROCFS) && !defined(CONFIG_NSH_DISABLE_PKILL)
|
||||
CMD_MAP("pkill", cmd_pkill, 2, 3, "[-<signal>] <name>"),
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_NSH_DISABLE_SLEEP
|
||||
CMD_MAP("sleep", cmd_sleep, 2, 2, "<sec>"),
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_NSH_DISABLE_USLEEP
|
||||
CMD_MAP("usleep", cmd_usleep, 2, 2, "<usec>"),
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(CONFIG_NSH_DISABLESCRIPT) && !defined(CONFIG_NSH_DISABLE_SOURCE)
|
||||
CMD_MAP("source", cmd_source, 2, 2, "<script-path>"),
|
||||
#endif
|
||||
|
|
@ -657,10 +663,6 @@ static const struct cmdmap_s g_cmdmap[] =
|
|||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_NSH_DISABLE_USLEEP
|
||||
CMD_MAP("usleep", cmd_usleep, 2, 2, "<usec>"),
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_NSH_DISABLE_WATCH
|
||||
CMD_MAP("watch", cmd_watch,
|
||||
2, 6, "[-n] interval [-c] count <command>"),
|
||||
|
|
|
|||
|
|
@ -995,7 +995,8 @@ int cmd_pidof(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv)
|
|||
* Name: cmd_kill
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef CONFIG_NSH_DISABLE_KILL
|
||||
#if !defined(CONFIG_NSH_DISABLE_KILL) && \
|
||||
!defined(CONFIG_DISABLE_ALL_SIGNALS)
|
||||
int cmd_kill(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv)
|
||||
{
|
||||
FAR char *ptr;
|
||||
|
|
@ -1098,7 +1099,8 @@ invalid_arg:
|
|||
* Name: cmd_pkill
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_FS_PROCFS) && !defined(CONFIG_NSH_DISABLE_PKILL)
|
||||
#if defined(CONFIG_FS_PROCFS) && !defined(CONFIG_NSH_DISABLE_PKILL) && \
|
||||
!defined(CONFIG_DISABLE_ALL_SIGNALS)
|
||||
int cmd_pkill(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv)
|
||||
{
|
||||
FAR const char *name;
|
||||
|
|
@ -1199,7 +1201,8 @@ invalid_arg:
|
|||
* Name: cmd_sleep
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef CONFIG_NSH_DISABLE_SLEEP
|
||||
#if !defined(CONFIG_NSH_DISABLE_SLEEP) && \
|
||||
!defined(CONFIG_DISABLE_ALL_SIGNALS)
|
||||
int cmd_sleep(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv)
|
||||
{
|
||||
UNUSED(argc);
|
||||
|
|
@ -1222,8 +1225,8 @@ int cmd_sleep(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv)
|
|||
/****************************************************************************
|
||||
* Name: cmd_usleep
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef CONFIG_NSH_DISABLE_USLEEP
|
||||
#if !defined(CONFIG_NSH_DISABLE_USLEEP) && \
|
||||
!defined(CONFIG_DISABLE_ALL_SIGNALS)
|
||||
int cmd_usleep(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv)
|
||||
{
|
||||
UNUSED(argc);
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
config SYSTEM_SENSORTEST
|
||||
tristate "Sensor driver test"
|
||||
default n
|
||||
depends on SENSORS
|
||||
depends on SENSORS && ENABLE_ALL_SIGNALS
|
||||
---help---
|
||||
Enable the Sensor driver test
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
config TESTING_NAND_SIM
|
||||
boolean "NAND Flash Simulator"
|
||||
depends on MTD_NAND_RAM
|
||||
depends on MTD_NAND_RAM && ENABLE_ALL_SIGNALS
|
||||
default n
|
||||
---help---
|
||||
Enable the NAND Flash Simulator device.
|
||||
|
|
|
|||
|
|
@ -22,14 +22,15 @@
|
|||
|
||||
if(CONFIG_TESTING_OSTEST)
|
||||
|
||||
set(SRCS
|
||||
getopt.c
|
||||
libc_memmem.c
|
||||
restart.c
|
||||
sigprocmask.c
|
||||
sighand.c
|
||||
signest.c
|
||||
sighelper.c)
|
||||
set(SRCS getopt.c libc_memmem.c restart.c sighelper.c)
|
||||
|
||||
if(CONFIG_ENABLE_ALL_SIGNALS)
|
||||
list(APPEND SRCS sighand.c signest.c)
|
||||
endif()
|
||||
|
||||
if(NOT CONFIG_DISABLE_ALL_SIGNALS)
|
||||
list(APPEND SRCS sigprocmask.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_DEV_NULL)
|
||||
list(APPEND SRCS dev_null.c)
|
||||
|
|
@ -124,7 +125,10 @@ if(CONFIG_TESTING_OSTEST)
|
|||
|
||||
if(NOT CONFIG_DISABLE_MQUEUE)
|
||||
if(NOT CONFIG_DISABLE_PTHREAD)
|
||||
list(APPEND SRCS mqueue.c timedmqueue.c)
|
||||
list(APPEND SRCS timedmqueue.c)
|
||||
if(NOT CONFIG_DISABLE_ALL_SIGNALS)
|
||||
list(APPEND SRCS mqueue.c)
|
||||
endif()
|
||||
endif() # CONFIG_DISABLE_PTHREAD
|
||||
endif() # CONFIG_DISABLE_MQUEUE
|
||||
|
||||
|
|
|
|||
|
|
@ -31,9 +31,17 @@ MODULE = $(CONFIG_TESTING_OSTEST)
|
|||
|
||||
# NuttX OS Test
|
||||
|
||||
CSRCS = getopt.c libc_memmem.c restart.c sigprocmask.c sighand.c \
|
||||
CSRCS = getopt.c libc_memmem.c restart.c \
|
||||
signest.c sighelper.c
|
||||
|
||||
ifeq ($(CONFIG_ENABLE_ALL_SIGNALS),y)
|
||||
CSRCS += sighand.c signest.c
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_DISABLE_ALL_SIGNALS),y)
|
||||
CSRCS += sigprocmask.c
|
||||
endif
|
||||
|
||||
MAINSRC = ostest_main.c
|
||||
|
||||
ifeq ($(CONFIG_DEV_NULL),y)
|
||||
|
|
@ -119,7 +127,10 @@ endif # CONFIG_DISABLE_PTHREAD
|
|||
|
||||
ifneq ($(CONFIG_DISABLE_MQUEUE),y)
|
||||
ifneq ($(CONFIG_DISABLE_PTHREAD),y)
|
||||
CSRCS += mqueue.c timedmqueue.c
|
||||
CSRCS += timedmqueue.c
|
||||
ifneq ($(CONFIG_DISABLE_ALL_SIGNALS),y)
|
||||
CSRCS += mqueue.c
|
||||
endif
|
||||
endif # CONFIG_DISABLE_PTHREAD
|
||||
endif # CONFIG_DISABLE_MQUEUE
|
||||
|
||||
|
|
|
|||
|
|
@ -496,14 +496,6 @@ static int user_main(int argc, char *argv[])
|
|||
check_test_memory_usage();
|
||||
#endif /* !CONFIG_DISABLE_PTHREAD */
|
||||
|
||||
#if !defined(CONFIG_DISABLE_MQUEUE) && !defined(CONFIG_DISABLE_PTHREAD)
|
||||
/* Verify pthreads and message queues */
|
||||
|
||||
printf("\nuser_main: message queue test\n");
|
||||
mqueue_test();
|
||||
check_test_memory_usage();
|
||||
#endif
|
||||
|
||||
#if !defined(CONFIG_DISABLE_MQUEUE) && !defined(CONFIG_DISABLE_PTHREAD)
|
||||
/* Verify pthreads and message queues */
|
||||
|
||||
|
|
@ -519,6 +511,14 @@ static int user_main(int argc, char *argv[])
|
|||
sigprocmask_test();
|
||||
check_test_memory_usage();
|
||||
|
||||
#if !defined(CONFIG_DISABLE_MQUEUE) && !defined(CONFIG_DISABLE_PTHREAD)
|
||||
/* Verify pthreads and message queues */
|
||||
|
||||
printf("\nuser_main: message queue test\n");
|
||||
mqueue_test();
|
||||
check_test_memory_usage();
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_SIG_SIGSTOP_ACTION) && defined(CONFIG_SIG_SIGKILL_ACTION) && \
|
||||
!defined(CONFIG_BUILD_KERNEL)
|
||||
printf("\nuser_main: signal action test\n");
|
||||
|
|
|
|||
|
|
@ -68,6 +68,11 @@ static pthread_addr_t i8sak_eventthread(pthread_addr_t arg)
|
|||
FAR struct ieee802154_primitive_s *primitive = NULL;
|
||||
int ret = OK;
|
||||
|
||||
#ifdef CONFIG_DISABLE_ALL_SIGNALS
|
||||
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
|
||||
pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, NULL);
|
||||
#endif
|
||||
|
||||
if (i8sak->mode == I8SAK_MODE_CHAR)
|
||||
{
|
||||
macarg.enable = true;
|
||||
|
|
@ -86,6 +91,9 @@ static pthread_addr_t i8sak_eventthread(pthread_addr_t arg)
|
|||
|
||||
while (i8sak->eventlistener_run)
|
||||
{
|
||||
#ifdef CONFIG_DISABLE_ALL_SIGNALS
|
||||
pthread_testcancel();
|
||||
#endif
|
||||
if (i8sak->mode == I8SAK_MODE_CHAR)
|
||||
{
|
||||
ret = ioctl(i8sak->fd, MAC802154IOC_GET_EVENT,
|
||||
|
|
@ -256,7 +264,13 @@ int i8sak_eventlistener_stop(FAR struct i8sak_s *i8sak)
|
|||
FAR void *value;
|
||||
|
||||
i8sak->eventlistener_run = false;
|
||||
|
||||
#ifdef CONFIG_DISABLE_ALL_SIGNALS
|
||||
pthread_cancel(i8sak->eventlistener_threadid);
|
||||
#else
|
||||
pthread_kill(i8sak->eventlistener_threadid, 2);
|
||||
#endif
|
||||
|
||||
ret = pthread_join(i8sak->eventlistener_threadid, &value);
|
||||
if (ret != OK)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue