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

Function ng_worklist_add

freebsd/netgraph/ng_base.c:3452–3475  ·  view source on GitHub ↗

* XXX * It's posible that a debugging NG_NODE_REF may need * to be outside the mutex zone */

Source from the content-addressed store, hash-verified

3450 * to be outside the mutex zone
3451 */
3452static void
3453ng_worklist_add(node_p node)
3454{
3455
3456 mtx_assert(&node->nd_input_queue.q_mtx, MA_OWNED);
3457
3458 if ((node->nd_input_queue.q_flags2 & NGQ2_WORKQ) == 0) {
3459 /*
3460 * If we are not already on the work queue,
3461 * then put us on.
3462 */
3463 node->nd_input_queue.q_flags2 |= NGQ2_WORKQ;
3464 NG_NODE_REF(node); /* XXX safe in mutex? */
3465 NG_WORKLIST_LOCK();
3466 STAILQ_INSERT_TAIL(&ng_worklist, node, nd_input_queue.q_work);
3467 NG_WORKLIST_UNLOCK();
3468 CTR3(KTR_NET, "%20s: node [%x] (%p) put on worklist", __func__,
3469 node->nd_ID, node);
3470 NG_WORKLIST_WAKEUP();
3471 } else {
3472 CTR3(KTR_NET, "%20s: node [%x] (%p) already on worklist",
3473 __func__, node->nd_ID, node);
3474 }
3475}
3476
3477/***********************************************************************
3478* Externally useable functions to set up a queue item ready for sending

Callers 3

ng_queue_rwFunction · 0.70
ng_upgrade_writeFunction · 0.70
ng_snd_itemFunction · 0.70

Calls 1

mtx_assertFunction · 0.85

Tested by

no test coverage detected