]> Cypherpunks repositories - gostls13.git/commit
internal/poll: use sync.Once instead to guard CopyFileRange() with kernel 5.3
authorAndy Pan <panjf2000@gmail.com>
Fri, 26 Aug 2022 19:29:19 +0000 (03:29 +0800)
committerGopher Robot <gobot@golang.org>
Mon, 29 Aug 2022 20:06:09 +0000 (20:06 +0000)
commitc108a682ff4571d1fd45e9c05cfad7b9a6c86a3d
tree83b06e989eb3c14a235ee30b83a9ee91963ea595
parent9da49a7d2e47919ecbf54e75bfc15ffb022cf1d6
internal/poll: use sync.Once instead to guard CopyFileRange() with kernel 5.3

The existing implementation creates more branches with more states: -1, 0, 1,
which makes it not very intuitive to understand, let's use sync.Once and boolean
instead to make it more straightforward.

Change-Id: I05766e5fdf7dba37d6565f84d3db4373f9342fe5
Reviewed-on: https://go-review.googlesource.com/c/go/+/425880
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
src/internal/poll/copy_file_range_linux.go