Remove intr param from pthread_mutex_take

This commit is contained in:
Marco Casaroli 2022-12-07 11:47:24 +01:00 committed by Xiang Xiao
parent 4cc7f3747c
commit 7ee8d38fda
5 changed files with 6 additions and 8 deletions

View File

@ -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

View File

@ -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;

View File

@ -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 */

View File

@ -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;

View File

@ -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.