net/http: fix TimeoutHandler data races; hold lock longer

The existing lock needed to be held longer. If a timeout occured
while writing (but after the guarded timeout check), the writes
would clobber a future connection's buffer.

Also remove a harmless warning by making Write also set the
flag that headers were sent (implicitly), so we don't try to
write headers later (a no-op + warning) on timeout after we've
started writing.

Fixes Issue 8414
Fixes Issue 8209

LGTM=ruiu, adg
R=adg, ruiu
CC=golang-codereviews
https://codereview.appspot.com/123610043
syscall: replace zsyscall_windows_*.go files with a single file

zsyscall_windows_386.go and zsyscall_windows_amd64.go contain same bytes

LGTM=r
R=golang-codereviews, r
CC=golang-codereviews
https://codereview.appspot.com/124640043

--HG--
rename : src/pkg/syscall/zsyscall_windows_386.go => src/pkg/syscall/zsyscall_windows.go
runtime: add atomicor8 for amd64p32

LGTM=khr
R=golang-codereviews, daniel.morsing, khr, rsc
CC=golang-codereviews, khr, rlh
https://codereview.appspot.com/131950043
runtime: convert memclrBytes to Go

LGTM=khr
R=khr
CC=golang-codereviews
https://codereview.appspot.com/131980043
runtime: remove unused variable

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://codereview.appspot.com/128230047
runtime: convert MemProfile, BlockProfile, ThreadCreateProfile to Go.

LGTM=khr
R=golang-codereviews, bradfitz, khr
CC=golang-codereviews
https://codereview.appspot.com/123680043
cmd/api: add missing runtime struct
Fixes build.

TBR=khr
R=golang-codereviews
CC=golang-codereviews, khr
https://codereview.appspot.com/130390044
runtime: fix deadlock when gctrace
Calling ReadMemStats which does stoptheworld on m0 holding locks
was not a good idea.
Stoptheworld holding locks is a recipe for deadlocks (added check for this).
Stoptheworld on g0 may or may not work (added check for this as well).
As far as I understand scavenger will print incorrect numbers now,
as stack usage is not subtracted from heap. But it's better than deadlocking.

LGTM=khr
R=golang-codereviews, rsc, khr
CC=golang-codereviews, rlh
https://codereview.appspot.com/124670043
runtime: init GC later
Init GC later as it needs to read GOGC env var.
Fixes issue 8562.

LGTM=daniel.morsing, rsc
R=golang-codereviews, daniel.morsing, rsc
CC=golang-codereviews, khr, rlh
https://codereview.appspot.com/130990043
cmd/gc: fix undefined behavior
UndefinedBehaviorSanitizer claims it is UB in C:
src/cmd/gc/racewalk.c:422:37: runtime error: member access within null pointer of type 'Node' (aka 'struct Node')
src/cmd/gc/racewalk.c:423:37: runtime error: member access within null pointer of type 'Node' (aka 'struct Node')

LGTM=rsc
R=dave, rsc
CC=golang-codereviews
https://codereview.appspot.com/125570043
net: fix typo

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://codereview.appspot.com/128500043
runtime: convert common scheduler functions to Go
These are required for chans, semaphores, timers, etc.

LGTM=khr
R=golang-codereviews, khr
CC=golang-codereviews, rlh, rsc
https://codereview.appspot.com/123640043
runtime: remove now arg from timer callback
Cleanup before converting to Go.
Fortunately nobody using it, because it is incorrect:
monotonic runtime time instead of claimed real time.

LGTM=khr
R=golang-codereviews, khr
CC=golang-codereviews, rsc
https://codereview.appspot.com/129480043
runtime: convert lfstack to Go
It is called from Go only in tests.

LGTM=khr
R=golang-codereviews, khr
CC=golang-codereviews, rlh, rsc
https://codereview.appspot.com/125610043

--HG--
rename : src/pkg/runtime/lfstack.goc => src/pkg/runtime/lfstack.c
A+C: Mark Theunissen (individual CLA)

Generated by a+c.

R=gobot
CC=golang-codereviews
https://codereview.appspot.com/126500044
net/http/httputil: Pass a Logger to ReverseProxy, allowing the user to control logging.

Fixes issue 8553.

LGTM=bradfitz
R=golang-codereviews, dave, bradfitz
CC=golang-codereviews
https://codereview.appspot.com/132750043

Committer: Brad Fitzpatrick <bradfitz@golang.org>
cmd/api: reduce stutter in runtime type stubs

LGTM=khr
R=khr
CC=dvyukov, golang-codereviews
https://codereview.appspot.com/132770044
A+C: Alberto Donizetti (individual CLA)

Generated by a+c.

R=gobot
CC=golang-codereviews
https://codereview.appspot.com/125660043
time: removed from tests now obsolete assumption about Australian tz abbreviations

Australian timezones abbreviation for standard and daylight saving time were recently
changed from EST for both to AEST and AEDT in the icann tz database (see changelog
on www.iana.org/time-zones).

A test in the time package was written to check that the ParseInLocation function
understand that Feb EST and Aug EST are different time zones, even though they are
both called EST. This is no longer the case, and the Date function now returns
AEST or AEDT for australian tz on every Linux system with an up to date tz database
(and this makes the test fail).

Since I wasn't able to find another country that 1) uses daylight saving and 2) has
the same abbreviation for both on tzdata, I changed the test to make sure that
ParseInLocation does not get confused when it parses, in different locations, two
dates with the same abbreviation (this was suggested in the mailing list).

Fixes issue 8547.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://codereview.appspot.com/130920043

Committer: Brad Fitzpatrick <bradfitz@golang.org>
runtime: give an explicit name to profiling Bucket sub-structs.

Fixes compilation of runtime on Solaris where the inner struct
was not called "_4_".

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://codereview.appspot.com/129460043