summaryrefslogtreecommitdiffhomepage
path: root/device/receive.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2021-05-07 09:26:24 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2021-05-07 09:26:24 +0200
commit69b39db0b42275235975594448fc66d011d78ee9 (patch)
tree4112698f889d4b6c7b37701cce8a6a345e417ff0 /device/receive.go
parentdb733ccd6531a2976008b87b3af35bece9ace2a9 (diff)
tun: windows: set event before waiting
In 097af6e ("tun: windows: protect reads from closing") we made sure no functions are running when End() is called, to avoid a UaF. But we still need to kick that event somehow, so that Read() is allowed to exit, in order to release the lock. So this commit calls SetEvent, while moving the closing boolean to be atomic so it can be modified without locks, and then moves to a WaitGroup for the RCU-like pattern. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'device/receive.go')
0 files changed, 0 insertions, 0 deletions