pthread_setcanceltype() and pthread_testcancel() do not have to be system calls if cancellation points are not enabled.

This commit is contained in:
Gregory Nutt
2016-12-10 07:40:48 -06:00
parent 18ce5496e4
commit e62b3bccd3
8 changed files with 37 additions and 21 deletions
+5 -2
View File
@@ -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
+1 -1
View File
@@ -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)
{
+1 -1
View File
@@ -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)
{