Unexpand TAILQ_FIRST(foo) == NULL to TAILQ_EMPTY.

Ok'ed by:	davidxu
This commit is contained in:
Xin LI 2006-04-13 03:09:34 +00:00
parent 6e8aee768a
commit 34562de4d5
4 changed files with 10 additions and 10 deletions

View File

@ -336,7 +336,7 @@ _pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
curthread);
/* Check for no more waiters: */
if (TAILQ_FIRST(&(*cond)->c_queue) == NULL)
if (TAILQ_EMPTY(&(*cond)->c_queue))
(*cond)->c_mutex = NULL;
}
}
@ -536,7 +536,7 @@ _pthread_cond_timedwait(pthread_cond_t * cond, pthread_mutex_t * mutex,
curthread);
/* Check for no more waiters: */
if (TAILQ_FIRST(&(*cond)->c_queue) == NULL)
if (TAILQ_EMPTY(&(*cond)->c_queue))
(*cond)->c_mutex = NULL;
}
@ -631,7 +631,7 @@ _pthread_cond_signal(pthread_cond_t * cond)
kse_wakeup(kmbx);
}
/* Check for no more waiters: */
if (TAILQ_FIRST(&(*cond)->c_queue) == NULL)
if (TAILQ_EMPTY(&(*cond)->c_queue))
(*cond)->c_mutex = NULL;
break;
@ -758,7 +758,7 @@ cond_wait_backout(void *arg)
cond_queue_remove(cond, curthread);
/* Check for no more waiters: */
if (TAILQ_FIRST(&cond->c_queue) == NULL)
if (TAILQ_EMPTY(&cond->c_queue))
cond->c_mutex = NULL;
break;

View File

@ -269,7 +269,7 @@ _pthread_mutex_destroy(pthread_mutex_t *mutex)
* Check to see if this mutex is in use:
*/
if (((*mutex)->m_owner != NULL) ||
(TAILQ_FIRST(&(*mutex)->m_queue) != NULL) ||
(!TAILQ_EMPTY(&(*mutex)->m_queue)) ||
((*mutex)->m_refcount != 0)) {
ret = EBUSY;

View File

@ -336,7 +336,7 @@ _pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
curthread);
/* Check for no more waiters: */
if (TAILQ_FIRST(&(*cond)->c_queue) == NULL)
if (TAILQ_EMPTY(&(*cond)->c_queue))
(*cond)->c_mutex = NULL;
}
}
@ -536,7 +536,7 @@ _pthread_cond_timedwait(pthread_cond_t * cond, pthread_mutex_t * mutex,
curthread);
/* Check for no more waiters: */
if (TAILQ_FIRST(&(*cond)->c_queue) == NULL)
if (TAILQ_EMPTY(&(*cond)->c_queue))
(*cond)->c_mutex = NULL;
}
@ -631,7 +631,7 @@ _pthread_cond_signal(pthread_cond_t * cond)
kse_wakeup(kmbx);
}
/* Check for no more waiters: */
if (TAILQ_FIRST(&(*cond)->c_queue) == NULL)
if (TAILQ_EMPTY(&(*cond)->c_queue))
(*cond)->c_mutex = NULL;
break;
@ -758,7 +758,7 @@ cond_wait_backout(void *arg)
cond_queue_remove(cond, curthread);
/* Check for no more waiters: */
if (TAILQ_FIRST(&cond->c_queue) == NULL)
if (TAILQ_EMPTY(&cond->c_queue))
cond->c_mutex = NULL;
break;

View File

@ -269,7 +269,7 @@ _pthread_mutex_destroy(pthread_mutex_t *mutex)
* Check to see if this mutex is in use:
*/
if (((*mutex)->m_owner != NULL) ||
(TAILQ_FIRST(&(*mutex)->m_queue) != NULL) ||
(!TAILQ_EMPTY(&(*mutex)->m_queue)) ||
((*mutex)->m_refcount != 0)) {
ret = EBUSY;