X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fsvm%2Fmessage_queue.h;h=bd76eda5d880a6694497e963f2682d15617d0ea9;hb=6d7dfcbfa4bc05f1308fc677f19ade44ea699da1;hp=1ef773d9f0a6d1542365f76d955e4962eac9136f;hpb=5398dfb2592d525018997a991a4f7bfde515adc4;p=vpp.git diff --git a/src/svm/message_queue.h b/src/svm/message_queue.h index 1ef773d9f0a..bd76eda5d88 100644 --- a/src/svm/message_queue.h +++ b/src/svm/message_queue.h @@ -125,6 +125,11 @@ uword svm_msg_q_size_to_alloc (svm_msg_q_cfg_t *cfg); void svm_msg_q_attach (svm_msg_q_t *mq, void *smq_base); +/** + * Cleanup mq's private data + */ +void svm_msg_q_cleanup (svm_msg_q_t *mq); + /** * Free message queue * @@ -399,11 +404,19 @@ svm_msg_q_unlock (svm_msg_q_t * mq) /** * Wait for message queue event * - * Must be called with mutex held. The queue only works non-blocking - * with eventfds, so handle blocking calls as an exception here. + * When eventfds are not configured, the shared memory mutex is locked + * before waiting on the condvar. Typically called by consumers. */ int svm_msg_q_wait (svm_msg_q_t *mq, svm_msg_q_wait_type_t type); +/** + * Wait for message queue event as producer + * + * Similar to @ref svm_msg_q_wait but lock (mutex or spinlock) must + * be held. Should only be called by producers. + */ +int svm_msg_q_wait_prod (svm_msg_q_t *mq); + /** * Timed wait for message queue event *