* XXX * It's posible that a debugging NG_NODE_REF may need * to be outside the mutex zone */
| 3450 | * to be outside the mutex zone |
| 3451 | */ |
| 3452 | static void |
| 3453 | ng_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 |
no test coverage detected