MCPcopy Create free account
hub / github.com/F-Stack/f-stack / mqueue_free

Function mqueue_free

freebsd/kern/uipc_mqueue.c:1622–1639  ·  view source on GitHub ↗

* Destroy a message queue */

Source from the content-addressed store, hash-verified

1620 * Destroy a message queue
1621 */
1622static void
1623mqueue_free(struct mqueue *mq)
1624{
1625 struct mqueue_msg *msg;
1626
1627 while ((msg = TAILQ_FIRST(&mq->mq_msgq)) != NULL) {
1628 TAILQ_REMOVE(&mq->mq_msgq, msg, msg_link);
1629 free(msg, M_MQUEUEDATA);
1630 }
1631
1632 mtx_destroy(&mq->mq_mutex);
1633 seldrain(&mq->mq_rsel);
1634 seldrain(&mq->mq_wsel);
1635 knlist_destroy(&mq->mq_rsel.si_note);
1636 knlist_destroy(&mq->mq_wsel.si_note);
1637 uma_zfree(mqueue_zone, mq);
1638 atomic_add_int(&curmq, -1);
1639}
1640
1641/*
1642 * Load a message from user space

Callers 3

mqfs_destroyFunction · 0.85
mqfs_createFunction · 0.85
kern_kmq_openFunction · 0.85

Calls 4

seldrainFunction · 0.85
knlist_destroyFunction · 0.85
freeFunction · 0.70
uma_zfreeFunction · 0.50

Tested by

no test coverage detected