Browse Source

Maintain a count of messages used in ckmsgq

master
Con Kolivas 10 years ago
parent
commit
a44d00bf43
  1. 1
      src/ckpool.c
  2. 1
      src/ckpool.h

1
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);

1
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;

Loading…
Cancel
Save