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
+2 -2
View File
@@ -90,12 +90,12 @@
"pthread_once","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_once_t*","CODE void (*)(void)"
"pthread_setaffinity_np","pthread.h","!defined(CONFIG_DISABLE_PTHREAD) && defined(CONFIG_SMP)","int","pthread_t","size_t","FAR const cpu_set_t*"
"pthread_setcancelstate","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","int","FAR int*"
"pthread_setcanceltype","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","int","FAR int*"
"pthread_setcanceltype","pthread.h","!defined(CONFIG_DISABLE_PTHREAD) && defined(CONFIG_CANCELLATION_POINTS)","int","int","FAR int*"
"pthread_setschedparam","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","pthread_t","int","FAR const struct sched_param*"
"pthread_setschedprio","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","pthread_t","int"
"pthread_setspecific","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","pthread_key_t","FAR const void*"
"pthread_sigmask","pthread.h","!defined(CONFIG_DISABLE_SIGNALS) && !defined(CONFIG_DISABLE_PTHREAD)","int","int","FAR const sigset_t*","FAR sigset_t*"
"pthread_testcancel","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","void"
"pthread_testcancel","pthread.h","!defined(CONFIG_DISABLE_PTHREAD) && defined(CONFIG_CANCELLATION_POINTS)","void"
"pthread_yield","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","void"
"putenv","stdlib.h","!defined(CONFIG_DISABLE_ENVIRON)","int","FAR const char*"
"read","unistd.h","CONFIG_NSOCKET_DESCRIPTORS > 0 || CONFIG_NFILE_DESCRIPTORS > 0","ssize_t","int","FAR void*","size_t"
1 _exit unistd.h void int
90 pthread_once pthread.h !defined(CONFIG_DISABLE_PTHREAD) int FAR pthread_once_t*
91 pthread_setaffinity_np pthread.h !defined(CONFIG_DISABLE_PTHREAD) && defined(CONFIG_SMP) int pthread_t
92 pthread_setcancelstate pthread.h !defined(CONFIG_DISABLE_PTHREAD) int int
93 pthread_setcanceltype pthread.h !defined(CONFIG_DISABLE_PTHREAD) !defined(CONFIG_DISABLE_PTHREAD) && defined(CONFIG_CANCELLATION_POINTS) int int
94 pthread_setschedparam pthread.h !defined(CONFIG_DISABLE_PTHREAD) int pthread_t
95 pthread_setschedprio pthread.h !defined(CONFIG_DISABLE_PTHREAD) int pthread_t
96 pthread_setspecific pthread.h !defined(CONFIG_DISABLE_PTHREAD) int pthread_key_t
97 pthread_sigmask pthread.h !defined(CONFIG_DISABLE_SIGNALS) && !defined(CONFIG_DISABLE_PTHREAD) int int
98 pthread_testcancel pthread.h !defined(CONFIG_DISABLE_PTHREAD) !defined(CONFIG_DISABLE_PTHREAD) && defined(CONFIG_CANCELLATION_POINTS) void
99 pthread_yield pthread.h !defined(CONFIG_DISABLE_PTHREAD) void
100 putenv stdlib.h !defined(CONFIG_DISABLE_ENVIRON) int FAR const char*
101 read unistd.h CONFIG_NSOCKET_DESCRIPTORS > 0 || CONFIG_NFILE_DESCRIPTORS > 0 ssize_t int
+4 -2
View File
@@ -291,12 +291,14 @@ SYSCALL_LOOKUP(up_assert, 2, STUB_up_assert)
SYSCALL_LOOKUP(pthread_mutex_unlock, 1, STUB_pthread_mutex_unlock)
SYSCALL_LOOKUP(pthread_once, 2, STUB_pthread_once)
SYSCALL_LOOKUP(pthread_setcancelstate, 2, STUB_pthread_setcancelstate)
SYSCALL_LOOKUP(pthread_setcanceltype, 2, STUB_pthread_setcanceltype)
SYSCALL_LOOKUP(pthread_setschedparam, 3, STUB_pthread_setschedparam)
SYSCALL_LOOKUP(pthread_setschedprio, 2, STUB_pthread_setschedprio)
SYSCALL_LOOKUP(pthread_setspecific, 2, STUB_pthread_setspecific)
SYSCALL_LOOKUP(pthread_testcancel, 0, STUB_pthread_testcancel)
SYSCALL_LOOKUP(pthread_yield, 0, STUB_pthread_yield)
# ifdef CONFIG_CANCELLATION_POINTS
SYSCALL_LOOKUP(pthread_setcanceltype, 2, STUB_pthread_setcanceltype)
SYSCALL_LOOKUP(pthread_testcancel, 0, STUB_pthread_testcancel)
# endif
# ifdef CONFIG_SMP
SYSCALL_LOOKUP(pthread_setaffinity, 3, STUB_pthread_setaffinity)
SYSCALL_LOOKUP(pthread_getaffinity, 3, STUB_pthread_getaffinity)
+4 -3
View File
@@ -292,17 +292,18 @@ uintptr_t STUB_pthread_mutex_unlock(int nbr, uintptr_t parm1);
uintptr_t STUB_pthread_once(int nbr, uintptr_t parm1, uintptr_t parm2);
uintptr_t STUB_pthread_setcancelstate(int nbr, uintptr_t parm1,
uintptr_t parm2);
uintptr_t STUB_pthread_setcanceltype(int nbr, uintptr_t parm1,
uintptr_t parm2);
uintptr_t STUB_pthread_setschedparam(int nbr, uintptr_t parm1,
uintptr_t parm2, uintptr_t parm3);
uintptr_t STUB_pthread_setschedprio(int nbr, uintptr_t parm1,
uintptr_t parm2);
uintptr_t STUB_pthread_setspecific(int nbr, uintptr_t parm1,
uintptr_t parm2);
uintptr_t STUB_pthread_testcancel(int nbr);
uintptr_t STUB_pthread_yield(int nbr);
uintptr_t STUB_pthread_setcanceltype(int nbr, uintptr_t parm1,
uintptr_t parm2);
uintptr_t STUB_pthread_testcancel(int nbr);
uintptr_t STUB_pthread_setaffinity(int nbr, uintptr_t parm1,
uintptr_t parm2, uintptr_t parm3);
uintptr_t STUB_pthread_getaffinity(int nbr, uintptr_t parm1,