diff --git a/src/ckpool.c b/src/ckpool.c index bac50095..82623475 100644 --- a/src/ckpool.c +++ b/src/ckpool.c @@ -183,6 +183,7 @@ void ckmsgq_add(ckmsgq_t *ckmsgq, void *data) msg->data = data; mutex_lock(ckmsgq->lock); + ckmsgq->messages++; DL_APPEND(ckmsgq->msgs, msg); pthread_cond_signal(ckmsgq->cond); mutex_unlock(ckmsgq->lock); diff --git a/src/ckpool.h b/src/ckpool.h index 83424fc5..27116b5c 100644 --- a/src/ckpool.h +++ b/src/ckpool.h @@ -38,6 +38,7 @@ struct ckmsgq { pthread_cond_t *cond; ckmsg_t *msgs; void (*func)(ckpool_t *, void *); + int64_t messages; }; typedef struct ckmsgq ckmsgq_t;