aboutsummaryrefslogtreecommitdiff
path: root/src/cmd
diff options
context:
space:
mode:
authorPatrick Mezard <patrick@mezard.eu>2015-05-10 15:35:52 +0200
committerAlex Brainman <alex.brainman@gmail.com>2015-06-11 01:33:25 +0000
commitd574b59fc71e52ac7feead94348ee61ef8d16a1c (patch)
treedad308ced266c6ede5a57d2e3f8111d728455743 /src/cmd
parentdc32b7f0fda20e6f3a4f893ca886681cb765739e (diff)
downloadgo-d574b59fc71e52ac7feead94348ee61ef8d16a1c.tar.xz
os: fix a race between Process.signal() and wait() on Windows
Process.handle was accessed without synchronization while wait() and signal() could be called concurrently. A first solution was to add a Mutex in Process but it was probably too invasive given Process.handle is only used on Windows. This version uses atomic operations to read the handle value. There is still a race between isDone() and the value of the handle, but it only leads to slightly incorrect error codes. The caller may get a: errors.New("os: process already finished") instead of: syscall.EINVAL which sounds harmless. Fixes #9382 Change-Id: Iefcc687a1166d5961c8f27154647b9b15a0f748a Reviewed-on: https://go-review.googlesource.com/9904 Reviewed-by: Alex Brainman <alex.brainman@gmail.com> Run-TryBot: Alex Brainman <alex.brainman@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/cmd')
0 files changed, 0 insertions, 0 deletions