X-Git-Url: http://git.harvie.cz/?a=blobdiff_plain;f=c%2Fpthread_extra%2Fpthread_msgqueue.c;h=b8562965eef620cce7a21c634bab85129071c4c9;hb=77c7dc7ffcaa64879e90178df5585f22790f46be;hp=ff1a37f865e65afdab274ebc76f061b2748d848e;hpb=ee099ba70d72016b26380b4532c0f9cfb73d484f;p=mirrors%2FPrograms.git diff --git a/c/pthread_extra/pthread_msgqueue.c b/c/pthread_extra/pthread_msgqueue.c index ff1a37f..b856296 100644 --- a/c/pthread_extra/pthread_msgqueue.c +++ b/c/pthread_extra/pthread_msgqueue.c @@ -39,6 +39,10 @@ size_t pthread_mq_waiting(pthread_mq_t *mq) { 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;