Skip to content

Commit d189a86

Browse files
hujun260xiaoxiang781216
authored andcommitted
system: pthread_barrierwait should be moved to kernel space
The current implementation requires the use of enter_critical_section, so the source code needs to be moved to kernel space Signed-off-by: hujun5 <[email protected]>
1 parent 5a2bc1c commit d189a86

File tree

5 files changed

+5
-2
lines changed

5 files changed

+5
-2
lines changed

include/sys/syscall_lookup.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ SYSCALL_LOOKUP(munmap, 2)
301301
/* The following are defined if pthreads are enabled */
302302

303303
#ifndef CONFIG_DISABLE_PTHREAD
304+
SYSCALL_LOOKUP(pthread_barrier_wait, 1)
304305
SYSCALL_LOOKUP(pthread_cancel, 1)
305306
SYSCALL_LOOKUP(pthread_cond_broadcast, 1)
306307
SYSCALL_LOOKUP(pthread_cond_signal, 1)

libs/libc/pthread/Make.defs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ CSRCS += pthread_attr_setstack.c pthread_attr_getstack.c
3737
CSRCS += pthread_attr_setschedparam.c pthread_attr_getschedparam.c
3838
CSRCS += pthread_barrierattr_init.c pthread_barrierattr_destroy.c
3939
CSRCS += pthread_barrierattr_getpshared.c pthread_barrierattr_setpshared.c
40-
CSRCS += pthread_barrierinit.c pthread_barrierdestroy.c pthread_barrierwait.c
40+
CSRCS += pthread_barrierinit.c pthread_barrierdestroy.c
4141
CSRCS += pthread_condattr_init.c pthread_condattr_destroy.c
4242
CSRCS += pthread_condattr_getpshared.c pthread_condattr_setpshared.c
4343
CSRCS += pthread_condattr_setclock.c pthread_condattr_getclock.c

sched/pthread/Make.defs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ CSRCS += pthread_condwait.c pthread_condsignal.c pthread_condbroadcast.c
2828
CSRCS += pthread_condclockwait.c pthread_sigmask.c pthread_cancel.c
2929
CSRCS += pthread_initialize.c pthread_completejoin.c pthread_findjoininfo.c
3030
CSRCS += pthread_release.c pthread_setschedprio.c
31+
CSRCS += pthread_barrierwait.c
3132

3233
ifneq ($(CONFIG_PTHREAD_MUTEX_UNSAFE),y)
3334
CSRCS += pthread_mutex.c pthread_mutexconsistent.c pthread_mutexinconsistent.c

libs/libc/pthread/pthread_barrierwait.c renamed to sched/pthread/pthread_barrierwait.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/****************************************************************************
2-
* libs/libc/pthread/pthread_barrierwait.c
2+
* sched/pthread/pthread_barrierwait.c
33
*
44
* Licensed to the Apache Software Foundation (ASF) under one or more
55
* contributor license agreements. See the NOTICE file distributed with

syscall/syscall.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@
9292
"prctl","sys/prctl.h","","int","int","...","uintptr_t","uintptr_t"
9393
"pread","unistd.h","","ssize_t","int","FAR void *","size_t","off_t"
9494
"pselect","sys/select.h","","int","int","FAR fd_set *","FAR fd_set *","FAR fd_set *","FAR const struct timespec *","FAR const sigset_t *"
95+
"pthread_barrier_wait","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_barrier_t *"
9596
"pthread_cancel","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","pthread_t"
9697
"pthread_cond_broadcast","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_cond_t *"
9798
"pthread_cond_clockwait","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_cond_t *","FAR pthread_mutex_t *","clockid_t","FAR const struct timespec *"

0 commit comments

Comments
 (0)