Minor cleanup from recent changes.
This commit is contained in:
parent
5a69453e16
commit
34c5e1c18f
6
TODO
6
TODO
@ -468,12 +468,6 @@ o pthreads (sched/pthreads)
|
||||
robust that determines which behavior is supported. non-robust
|
||||
should be the default. NuttX does not support this attribute
|
||||
and robust behavior is the default and only supported behavior.
|
||||
|
||||
The spec is not clear, but I think there there is also missing
|
||||
logic when the thread exits. I believe that the next highest
|
||||
prority thread waiting for the mutex should be awakend and
|
||||
pthread_mutex_lock() should return EOWNERDEAD.
|
||||
That does not happen now. They will just remain blocked.
|
||||
Status: Open
|
||||
Priority: Low. The non-robust behavior is dangerous and really should never
|
||||
be used.
|
||||
|
@ -228,7 +228,7 @@ struct pthread_mutexattr_s
|
||||
{
|
||||
uint8_t pshared; /* PTHREAD_PROCESS_PRIVATE or PTHREAD_PROCESS_SHARED */
|
||||
#ifdef CONFIG_PRIORITY_INHERITANCE
|
||||
uint8_t proto; /* See _PTHREAD_PRIO_* definitions */
|
||||
uint8_t proto; /* See PTHREAD_PRIO_* definitions */
|
||||
#endif
|
||||
#ifdef CONFIG_MUTEX_TYPES
|
||||
uint8_t type; /* Type of the mutex. See PTHREAD_MUTEX_* definitions */
|
||||
@ -248,7 +248,7 @@ struct pthread_mutex_s
|
||||
|
||||
sem_t sem; /* Semaphore underlying the implementation of the mutex */
|
||||
pid_t pid; /* ID of the holder of the mutex */
|
||||
uint8_t flags; /* See PTHREAD_MFLAGS_* */
|
||||
uint8_t flags; /* See _PTHREAD_MFLAGS_* */
|
||||
#ifdef CONFIG_MUTEX_TYPES
|
||||
uint8_t type; /* Type of the mutex. See PTHREAD_MUTEX_* definitions */
|
||||
int16_t nlocks; /* The number of recursive locks held */
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user