mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 00:14:22 +08:00
Minor cleanup from recent changes.
This commit is contained in:
@@ -109,8 +109,8 @@ FAR struct join_s *pthread_findjoininfo(FAR struct task_group_s *group,
|
||||
void pthread_release(FAR struct task_group_s *group);
|
||||
int pthread_takesemaphore(sem_t *sem, bool intr);
|
||||
int pthread_givesemaphore(sem_t *sem);
|
||||
int pthread_takemutex(FAR struct pthread_mutex_s *mutex, bool intr);
|
||||
int pthread_givemutex(FAR struct pthread_mutex_s *mutex);
|
||||
int pthread_mutex_take(FAR struct pthread_mutex_s *mutex, bool intr);
|
||||
int pthread_mutex_give(FAR struct pthread_mutex_s *mutex);
|
||||
void pthread_mutex_inconsistent(FAR struct pthread_tcb_s *tcb);
|
||||
|
||||
#ifdef CONFIG_MUTEX_TYPES
|
||||
|
||||
@@ -260,7 +260,7 @@ int pthread_cond_timedwait(FAR pthread_cond_t *cond, FAR pthread_mutex_t *mutex,
|
||||
/* Give up the mutex */
|
||||
|
||||
mutex->pid = -1;
|
||||
ret = pthread_givemutex(mutex);
|
||||
ret = pthread_mutex_give(mutex);
|
||||
if (ret != 0)
|
||||
{
|
||||
/* Restore interrupts (pre-emption will be enabled when
|
||||
@@ -316,7 +316,7 @@ int pthread_cond_timedwait(FAR pthread_cond_t *cond, FAR pthread_mutex_t *mutex,
|
||||
/* Reacquire the mutex (retaining the ret). */
|
||||
|
||||
sinfo("Re-locking...\n");
|
||||
status = pthread_takemutex(mutex, false);
|
||||
status = pthread_mutex_take(mutex, false);
|
||||
if (status == OK)
|
||||
{
|
||||
mutex->pid = mypid;
|
||||
|
||||
@@ -101,7 +101,7 @@ int pthread_cond_wait(FAR pthread_cond_t *cond, FAR pthread_mutex_t *mutex)
|
||||
|
||||
sched_lock();
|
||||
mutex->pid = -1;
|
||||
ret = pthread_givemutex(mutex);
|
||||
ret = pthread_mutex_give(mutex);
|
||||
|
||||
/* Take the semaphore */
|
||||
|
||||
@@ -122,7 +122,7 @@ int pthread_cond_wait(FAR pthread_cond_t *cond, FAR pthread_mutex_t *mutex)
|
||||
*/
|
||||
|
||||
sinfo("Reacquire mutex...\n");
|
||||
status = pthread_takemutex(mutex, false);
|
||||
status = pthread_mutex_take(mutex, false);
|
||||
if (ret == OK)
|
||||
{
|
||||
/* Report the first failure that occurs */
|
||||
|
||||
@@ -185,7 +185,7 @@ int pthread_mutex_lock(FAR pthread_mutex_t *mutex)
|
||||
{
|
||||
/* Take the underlying semaphore, waiting if necessary */
|
||||
|
||||
ret = pthread_takemutex(mutex, true);
|
||||
ret = pthread_mutex_take(mutex, true);
|
||||
|
||||
/* If we successfully obtained the semaphore, then indicate
|
||||
* that we own it.
|
||||
|
||||
@@ -139,7 +139,7 @@ int pthread_mutex_unlock(FAR pthread_mutex_t *mutex)
|
||||
#ifdef CONFIG_MUTEX_TYPES
|
||||
mutex->nlocks = 0;
|
||||
#endif
|
||||
ret = pthread_givemutex(mutex);
|
||||
ret = pthread_mutex_give(mutex);
|
||||
}
|
||||
|
||||
sched_unlock();
|
||||
|
||||
Reference in New Issue
Block a user