Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Protect stats with RWMutex #151

Merged
merged 2 commits into from
Mar 12, 2021
Merged

Protect stats with RWMutex #151

merged 2 commits into from
Mar 12, 2021

Commits on Mar 11, 2021

  1. Protect stats with RWMutex

    updateStats() now also updates rtts so it is protected by the
    lock.
    Statistics() should now be callable from other goroutines.
    
    PacketsSent and PacketsRecvDuplicates can still be updated while
    Statistics() is running, and thus could yield strange results
    (sent<recv)
    
    To fix this, atomics could be used, but it would require changing the
    types of the fields from int to int64, thus changing the public api.
    
    Signed-off-by: Jean Raby <jean@raby.sh>
    jraby committed Mar 11, 2021
    Configuration menu
    Copy the full SHA
    ea507d9 View commit details
    Browse the repository at this point in the history
  2. s/statsmu/statsMu/

    jraby committed Mar 11, 2021
    Configuration menu
    Copy the full SHA
    e7554be View commit details
    Browse the repository at this point in the history