diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2021-04-26 22:22:45 -0400 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2021-04-26 22:22:45 -0400 |
commit | 097af6e1351ba80a18b8f63e9c07b9bd13b632bb (patch) | |
tree | 71053b525918fdf2fcde1793bb9e5986260050a9 /README.md | |
parent | 8246d251ea9b9cbef07082bd69280a8f988cec0c (diff) |
tun: windows: protect reads from closing
The code previously used the old errors channel for checking, rather
than the simpler boolean, which caused issues on shutdown, since the
errors channel was meaningless. However, looking at this exposed a more
basic problem: Close() and all the other functions that check the closed
boolean can race. So protect with a basic RW lock, to ensure that
Close() waits for all pending operations to complete.
Reported-by: Joshua Sjoding <joshua.sjoding@scjalliance.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'README.md')
0 files changed, 0 insertions, 0 deletions