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

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

commit 7ee8d38fda1af6f4b63b3b624a59300e7a738b91
Author: Marco Casaroli <[email protected]>
AuthorDate: Wed Dec 7 11:47:24 2022 +0100

    Remove `intr` param from `pthread_mutex_take`
---
 sched/pthread/pthread.h                | 4 ++--
 sched/pthread/pthread_condclockwait.c  | 2 +-
 sched/pthread/pthread_condwait.c       | 2 +-
 sched/pthread/pthread_mutex.c          | 4 +---
 sched/pthread/pthread_mutextimedlock.c | 2 +-
 5 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/sched/pthread/pthread.h b/sched/pthread/pthread.h
index 29f7ced306..c02d6bd729 100644
--- a/sched/pthread/pthread.h
+++ b/sched/pthread/pthread.h
@@ -96,12 +96,12 @@ int pthread_sem_give(sem_t *sem);
 
 #ifndef CONFIG_PTHREAD_MUTEX_UNSAFE
 int pthread_mutex_take(FAR struct pthread_mutex_s *mutex,
-                       FAR const struct timespec *abs_timeout, bool intr);
+                       FAR const struct timespec *abs_timeout);
 int pthread_mutex_trytake(FAR struct pthread_mutex_s *mutex);
 int pthread_mutex_give(FAR struct pthread_mutex_s *mutex);
 void pthread_mutex_inconsistent(FAR struct tcb_s *tcb);
 #else
-#  define pthread_mutex_take(m,abs_timeout,i)  
pthread_sem_take(&(m)->sem,(abs_timeout))
+#  define pthread_mutex_take(m,abs_timeout)  
pthread_sem_take(&(m)->sem,(abs_timeout))
 #  define pthread_mutex_trytake(m)             pthread_sem_trytake(&(m)->sem)
 #  define pthread_mutex_give(m)                pthread_sem_give(&(m)->sem)
 #endif
diff --git a/sched/pthread/pthread_condclockwait.c 
b/sched/pthread/pthread_condclockwait.c
index 4f1adb02a2..0619770399 100644
--- a/sched/pthread/pthread_condclockwait.c
+++ b/sched/pthread/pthread_condclockwait.c
@@ -159,7 +159,7 @@ int pthread_cond_clockwait(FAR pthread_cond_t *cond,
 
       sinfo("Re-locking...\n");
 
-      status = pthread_mutex_take(mutex, NULL, false);
+      status = pthread_mutex_take(mutex, NULL);
       if (status == OK)
         {
           mutex->pid    = mypid;
diff --git a/sched/pthread/pthread_condwait.c b/sched/pthread/pthread_condwait.c
index 08a09ae924..9252ac0bd8 100644
--- a/sched/pthread/pthread_condwait.c
+++ b/sched/pthread/pthread_condwait.c
@@ -126,7 +126,7 @@ int pthread_cond_wait(FAR pthread_cond_t *cond, FAR 
pthread_mutex_t *mutex)
 
       sinfo("Reacquire mutex...\n");
 
-      status = pthread_mutex_take(mutex, NULL, false);
+      status = pthread_mutex_take(mutex, NULL);
       if (ret == OK)
         {
           /* Report the first failure that occurs */
diff --git a/sched/pthread/pthread_mutex.c b/sched/pthread/pthread_mutex.c
index 4c9ebbdb9b..d609608b02 100644
--- a/sched/pthread/pthread_mutex.c
+++ b/sched/pthread/pthread_mutex.c
@@ -132,8 +132,6 @@ static void pthread_mutex_remove(FAR struct pthread_mutex_s 
*mutex)
  *
  * Input Parameters:
  *  mutex - The mutex to be locked
- *  intr  - false: ignore EINTR errors when locking; true treat EINTR as
- *          other errors by returning the errno value
  *
  * Returned Value:
  *   0 on success or an errno value on failure.
@@ -141,7 +139,7 @@ static void pthread_mutex_remove(FAR struct pthread_mutex_s 
*mutex)
  ****************************************************************************/
 
 int pthread_mutex_take(FAR struct pthread_mutex_s *mutex,
-                       FAR const struct timespec *abs_timeout, bool intr)
+                       FAR const struct timespec *abs_timeout)
 {
   int ret = EINVAL;
 
diff --git a/sched/pthread/pthread_mutextimedlock.c 
b/sched/pthread/pthread_mutextimedlock.c
index 58a196cb3c..73ba069920 100644
--- a/sched/pthread/pthread_mutextimedlock.c
+++ b/sched/pthread/pthread_mutextimedlock.c
@@ -187,7 +187,7 @@ int pthread_mutex_timedlock(FAR pthread_mutex_t *mutex,
            * or default mutex.
            */
 
-          ret = pthread_mutex_take(mutex, abs_timeout, false);
+          ret = pthread_mutex_take(mutex, abs_timeout);
 
           /* If we successfully obtained the semaphore, then indicate
            * that we own it.

Reply via email to