Adds unregister_and_flush to allow a node to unregister from the
backend and block until all that node's listener callbacks have returned. This is
particularly useful when using async listeners, as they may still be processing
packets after the listener has been removed from the backend.
Note that this may also block forever if the listener callbacks are not
designed to return (such as in mirage-tcpip).
Each call to the listener callback now increments a counter per mac/node, which is
decremented when the call returns and a condition variable is signalled. The new
unregister_and_flush function will wait for the counter to reach 0 before unregistering
the node id.
Adds
unregister_and_flush
to allow a node to unregister from the backend and block until all that node's listener callbacks have returned. This is particularly useful when using async listeners, as they may still be processing packets after the listener has been removed from the backend.Note that this may also block forever if the listener callbacks are not designed to return (such as in
mirage-tcpip
).Each call to the listener callback now increments a counter per mac/node, which is decremented when the call returns and a condition variable is signalled. The new
unregister_and_flush
function will wait for the counter to reach 0 before unregistering the node id.