return mq->msg_count;
}
+size_t pthread_mq_vacant(pthread_mq_t *mq) {
+ return (mq->msg_count_max - mq->msg_count);
+}
+
bool pthread_mq_reset(pthread_mq_t *mq) {
if(pthread_mutex_lock(&mq->lock)) return false;
mq->msg_count = 0;
ret = pthread_cond_wait(&mq->cond_writable, &mq->lock);
} else {
//printf("STimed: %p\n", abs_timeout);
- assert(abs_timeout != NULL);
+ //assert(abs_timeout != NULL);
ret = pthread_cond_timedwait(&mq->cond_writable, &mq->lock, abs_timeout);
}
if(ret) {
ret = pthread_cond_wait(&mq->cond_readable, &mq->lock);
} else {
//printf("RTimed: %p\n", abs_timeout);
- assert(abs_timeout != NULL);
+ //assert(abs_timeout != NULL);
ret = pthread_cond_timedwait(&mq->cond_readable, &mq->lock, abs_timeout);
}
if(ret) {