You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need to be sure that print_net_receive is not re-entrant otherwise printing_net_receive will be toggled back off. This is easy in this particular case, but can be non-obvious in other cases.
We must not return, because otherwise printing_net_receive will stay true indefinitely.
While printing code we have the following pattern:
The problem is that:
print_net_receive
is not re-entrant otherwiseprinting_net_receive
will be toggled back off. This is easy in this particular case, but can be non-obvious in other cases.return
, because otherwiseprinting_net_receive
will staytrue
indefinitely.The solution is to use a RAII guard:
The text was updated successfully, but these errors were encountered: