mirror of
https://github.com/apache/nuttx.git
synced 2026-05-26 10:46:28 +08:00
libs/pthread: disable pthread_kill when no signals
pthread_kill depends on signasl, so when all signals are disabled disable pthread_kill too Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
This commit is contained in:
committed by
Xiang Xiao
parent
57bdb4e660
commit
5060ee80d1
@@ -76,7 +76,6 @@ if(NOT CONFIG_DISABLE_PTHREAD)
|
||||
pthread_create.c
|
||||
pthread_equal.c
|
||||
pthread_exit.c
|
||||
pthread_kill.c
|
||||
pthread_setname_np.c
|
||||
pthread_getname_np.c
|
||||
pthread_get_stackaddr_np.c
|
||||
@@ -132,6 +131,10 @@ if(NOT CONFIG_DISABLE_PTHREAD)
|
||||
list(APPEND SRCS pthread_spinlock.c)
|
||||
endif()
|
||||
|
||||
if(NOT CONFIG_DISABLE_ALL_SIGNALS)
|
||||
list(APPEND SRCS pthread_kill.c)
|
||||
endif()
|
||||
|
||||
if(NOT CONFIG_TLS_NCLEANUP EQUAL 0)
|
||||
list(APPEND SRCS pthread_cleanup.c)
|
||||
endif()
|
||||
|
||||
@@ -47,7 +47,7 @@ CSRCS += pthread_condattr_getpshared.c pthread_condattr_setpshared.c
|
||||
CSRCS += pthread_condattr_setclock.c pthread_condattr_getclock.c
|
||||
CSRCS += pthread_condinit.c pthread_conddestroy.c pthread_condtimedwait.c
|
||||
CSRCS += pthread_equal.c pthread_condbroadcast.c pthread_condclockwait.c pthread_condsignal.c
|
||||
CSRCS += pthread_condwait.c pthread_create.c pthread_exit.c pthread_kill.c
|
||||
CSRCS += pthread_condwait.c pthread_create.c pthread_exit.c
|
||||
CSRCS += pthread_setname_np.c pthread_getname_np.c
|
||||
CSRCS += pthread_get_stackaddr_np.c pthread_get_stacksize_np.c
|
||||
CSRCS += pthread_mutexattr_init.c pthread_mutexattr_destroy.c
|
||||
@@ -69,6 +69,10 @@ CSRCS += pthread_testcancel.c pthread_getcpuclockid.c
|
||||
CSRCS += pthread_self.c pthread_gettid_np.c
|
||||
CSRCS += pthread_concurrency.c
|
||||
|
||||
ifneq ($(CONFIG_DISABLE_ALL_SIGNALS),y)
|
||||
CSRCS += pthread_kill.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_SMP),y)
|
||||
CSRCS += pthread_attr_getaffinity.c pthread_attr_setaffinity.c
|
||||
endif
|
||||
|
||||
@@ -90,6 +90,7 @@ int pthread_mutex_destroy(FAR pthread_mutex_t *mutex)
|
||||
* nxsched_get_tcb() does.
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_DISABLE_ALL_SIGNALS
|
||||
if (pthread_kill(pid, 0) != 0)
|
||||
{
|
||||
/* The thread associated with the PID no longer exists */
|
||||
@@ -121,6 +122,7 @@ int pthread_mutex_destroy(FAR pthread_mutex_t *mutex)
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
ret = EBUSY;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user