This is an automated email from the ASF dual-hosted git repository.

gnutt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 81a01d089b7fa3be3ed94971712ac97500dfdb87
Author: Huang Qi <[email protected]>
AuthorDate: Thu May 6 16:01:16 2021 +0800

    libc/pthread: Fix comment and document issue
    
    Signed-off-by: Huang Qi <[email protected]>
---
 arch/arm/src/armv7-a/arm_syscall.c           |  2 +-
 arch/arm/src/armv7-r/arm_syscall.c           |  2 +-
 arch/risc-v/src/common/riscv_pthread_start.c |  2 +-
 include/nuttx/pthread.h                      | 16 +++++++++-------
 libs/libc/pthread/pthread_exit.c             |  2 +-
 sched/pthread/pthread_create.c               | 12 +++++++-----
 sched/pthread/pthread_exit.c                 |  2 +-
 7 files changed, 21 insertions(+), 17 deletions(-)

diff --git a/arch/arm/src/armv7-a/arm_syscall.c 
b/arch/arm/src/armv7-a/arm_syscall.c
index e71a6b0..985dc63 100644
--- a/arch/arm/src/armv7-a/arm_syscall.c
+++ b/arch/arm/src/armv7-a/arm_syscall.c
@@ -293,7 +293,7 @@ uint32_t *arm_syscall(uint32_t *regs)
 #if !defined(CONFIG_BUILD_FLAT) && !defined(CONFIG_DISABLE_PTHREAD)
       case SYS_pthread_start:
         {
-          /* Set up to return to the user-space pthread start-up function in
+          /* Set up to enter the user-space pthread start-up function in
            * unprivileged mode. We need:
            *
            *   R0   = entrypt
diff --git a/arch/arm/src/armv7-r/arm_syscall.c 
b/arch/arm/src/armv7-r/arm_syscall.c
index ea827bf..29095d0 100644
--- a/arch/arm/src/armv7-r/arm_syscall.c
+++ b/arch/arm/src/armv7-r/arm_syscall.c
@@ -288,7 +288,7 @@ uint32_t *arm_syscall(uint32_t *regs)
 #if !defined(CONFIG_BUILD_FLAT) && !defined(CONFIG_DISABLE_PTHREAD)
       case SYS_pthread_start:
         {
-          /* Set up to return to the user-space pthread start-up function in
+          /* Set up to enter the user-space pthread start-up function in
            * unprivileged mode. We need:
            *
            *   R0   = startup
diff --git a/arch/risc-v/src/common/riscv_pthread_start.c 
b/arch/risc-v/src/common/riscv_pthread_start.c
index 723f7ca..20b5608 100644
--- a/arch/risc-v/src/common/riscv_pthread_start.c
+++ b/arch/risc-v/src/common/riscv_pthread_start.c
@@ -64,7 +64,7 @@
 void up_pthread_start(pthread_trampoline_t startup,
                       pthread_startroutine_t entrypt, pthread_addr_t arg)
 {
-  /* Let sys_call2() do all of the work */
+  /* Let sys_call3() do all of the work */
 
   sys_call3(SYS_pthread_start, (uintptr_t)startup, (uintptr_t)entrypt,
             (uintptr_t)arg);
diff --git a/include/nuttx/pthread.h b/include/nuttx/pthread.h
index aa21cd6..d8e30aa 100644
--- a/include/nuttx/pthread.h
+++ b/include/nuttx/pthread.h
@@ -133,11 +133,13 @@ EXTERN const pthread_attr_t g_default_pthread_attr;
  *   attributes.
  *
  * Input Parameters:
- *    trampoline
- *    thread
- *    attr
- *    start_routine
- *    arg
+ *    trampoline - The user space startup function
+ *    thread     - The pthread handle to be used
+ *    attr       - It points to a pthread_attr_t structure whose contents are
+ *                 used at thread creation time to determine attributes
+ *                 for the new thread
+ *    entry      - The new thread starts execution by invoking entry
+ *    arg        - It is passed as the sole argument of entry
  *
  * Returned Value:
  *   OK (0) on success; a (non-negated) errno value on failure. The errno
@@ -156,7 +158,7 @@ int nx_pthread_create(pthread_trampoline_t trampoline, FAR 
pthread_t *thread,
  *   Terminate execution of a thread started with pthread_create.
  *
  * Input Parameters:
- *   exit_valie
+ *   exit_value
  *
  * Returned Value:
  *   None
@@ -176,7 +178,7 @@ void nx_pthread_exit(FAR void *exit_value) 
noreturn_function;
  *   within the pthread_exit() and pthread_cancellation() logic
  *
  * Input Parameters:
- *   tcb - The TCB of the pthread that is exiting or being canceled.
+ *   None
  *
  * Returned Value:
  *   None
diff --git a/libs/libc/pthread/pthread_exit.c b/libs/libc/pthread/pthread_exit.c
index 740a325..2e456b6 100644
--- a/libs/libc/pthread/pthread_exit.c
+++ b/libs/libc/pthread/pthread_exit.c
@@ -40,7 +40,7 @@
  *   Terminate execution of a thread started with pthread_create.
  *
  * Input Parameters:
- *   exit_valie
+ *   exit_value
  *
  * Returned Value:
  *   None
diff --git a/sched/pthread/pthread_create.c b/sched/pthread/pthread_create.c
index 22cd008..ade4dc6 100644
--- a/sched/pthread/pthread_create.c
+++ b/sched/pthread/pthread_create.c
@@ -208,11 +208,13 @@ static void pthread_start(void)
  *   attributes.
  *
  * Input Parameters:
- *    trampoline
- *    thread
- *    attr
- *    start_routine
- *    arg
+ *    trampoline - The user space startup function
+ *    thread     - The pthread handle to be used
+ *    attr       - It points to a pthread_attr_t structure whose contents are
+ *                 used at thread creation time to determine attributes
+ *                 for the new thread
+ *    entry      - The new thread starts execution by invoking entry
+ *    arg        - It is passed as the sole argument of entry
  *
  * Returned Value:
  *   OK (0) on success; a (non-negated) errno value on failure. The errno
diff --git a/sched/pthread/pthread_exit.c b/sched/pthread/pthread_exit.c
index a7704ab..4d55560 100644
--- a/sched/pthread/pthread_exit.c
+++ b/sched/pthread/pthread_exit.c
@@ -50,7 +50,7 @@
  *   Terminate execution of a thread started with pthread_create.
  *
  * Input Parameters:
- *   exit_valie
+ *   exit_value
  *
  * Returned Value:
  *   None

Reply via email to