hashicorp / yamux

Golang connection multiplexing library
Mozilla Public License 2.0
2.25k stars 236 forks source link

Fix race around read and write deadlines in Stream #52

Closed filipochnik closed 6 years ago

filipochnik commented 6 years ago

I found this race condition when running my code using yamux with -race.

Since the test suite fails when run with -race I don't think I can write a meaningful test here.

jefferai commented 6 years ago

I think it is likely to be faster to use an atomic.Value here, since it is only being read in one place and written in another.

filipochnik commented 6 years ago

Sure, I changed it to atomic.Value :)

jefferai commented 6 years ago

Thanks!