mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 08:36:24 +08:00
pthread_setcanceltype() and pthread_testcancel() do not have to be system calls if cancellation points are not enabled.
This commit is contained in:
@@ -42,8 +42,7 @@ CSRCS += pthread_mutexlock.c pthread_mutextrylock.c pthread_mutexunlock.c
|
||||
CSRCS += pthread_condinit.c pthread_conddestroy.c
|
||||
CSRCS += pthread_condwait.c pthread_condsignal.c pthread_condbroadcast.c
|
||||
CSRCS += pthread_barrierinit.c pthread_barrierdestroy.c pthread_barrierwait.c
|
||||
CSRCS += pthread_cancel.c pthread_setcancelstate.c pthread_setcanceltype.c
|
||||
CSRCS += pthread_testcancel.c
|
||||
CSRCS += pthread_cancel.c pthread_setcancelstate.c
|
||||
CSRCS += pthread_keycreate.c pthread_setspecific.c pthread_getspecific.c
|
||||
CSRCS += pthread_keydelete.c
|
||||
CSRCS += pthread_initialize.c pthread_completejoin.c pthread_findjoininfo.c
|
||||
@@ -53,6 +52,10 @@ ifneq ($(CONFIG_DISABLE_SIGNALS),y)
|
||||
CSRCS += pthread_condtimedwait.c pthread_kill.c pthread_sigmask.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CANCELLATION_POINTS),y)
|
||||
CSRCS += pthread_setcanceltype.c pthread_testcancel.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_SMP),y)
|
||||
CSRCS += pthread_setaffinity.c pthread_getaffinity.c
|
||||
endif
|
||||
|
||||
@@ -78,7 +78,7 @@ int pthread_setcancelstate(int state, FAR int *oldstate)
|
||||
|
||||
/* Return the current state if so requrested */
|
||||
|
||||
if (oldstate)
|
||||
if (oldstate != NULL)
|
||||
{
|
||||
if ((tcb->flags & TCB_FLAG_NONCANCELABLE) != 0)
|
||||
{
|
||||
|
||||
@@ -77,7 +77,7 @@ int pthread_setcanceltype(int type, FAR int *oldtype)
|
||||
|
||||
/* Return the current type if so requrested */
|
||||
|
||||
if (oldtype)
|
||||
if (oldtype != NULL)
|
||||
{
|
||||
if ((tcb->flags & TCB_FLAG_CANCEL_DEFERRED) != 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user