|
|
@ -165,9 +165,10 @@ void ckmsgq_add(ckmsgq_t *ckmsgq, void *data) |
|
|
|
/* Return whether there are any messages queued in the ckmsgq linked list. */ |
|
|
|
/* Return whether there are any messages queued in the ckmsgq linked list. */ |
|
|
|
bool ckmsgq_empty(ckmsgq_t *ckmsgq) |
|
|
|
bool ckmsgq_empty(ckmsgq_t *ckmsgq) |
|
|
|
{ |
|
|
|
{ |
|
|
|
bool ret; |
|
|
|
bool ret = true; |
|
|
|
|
|
|
|
|
|
|
|
mutex_lock(&ckmsgq->lock); |
|
|
|
mutex_lock(&ckmsgq->lock); |
|
|
|
|
|
|
|
if (ckmsgq->msgs) |
|
|
|
ret = (ckmsgq->msgs->next == ckmsgq->msgs->prev); |
|
|
|
ret = (ckmsgq->msgs->next == ckmsgq->msgs->prev); |
|
|
|
mutex_unlock(&ckmsgq->lock); |
|
|
|
mutex_unlock(&ckmsgq->lock); |
|
|
|
|
|
|
|
|
|
|
|