clib_spinlock_init (&mq->q.lock);
}
+void
+svm_msg_q_cleanup (svm_msg_q_t *mq)
+{
+ vec_free (mq->rings);
+ clib_spinlock_free (&mq->q.lock);
+ if (mq->q.evtfd != -1)
+ close (mq->q.evtfd);
+}
+
void
svm_msg_q_free (svm_msg_q_t * mq)
{
+ svm_msg_q_cleanup (mq);
clib_mem_free (mq->q.shr);
- clib_spinlock_free (&mq->q.lock);
clib_mem_free (mq);
}
svm_msg_q_alloc_eventfd (svm_msg_q_t *mq)
{
int fd;
- if ((fd = eventfd (0, EFD_NONBLOCK)) < 0)
+ if ((fd = eventfd (0, 0)) < 0)
return -1;
svm_msg_q_set_eventfd (mq, fd);
return 0;