go/src/sync
Diogo Pinela 9ff7df003d sync: make WaitGroup more space-efficient
The struct stores its 64-bit state field in a 12-byte array to
ensure that it can be 64-bit-aligned. This leaves 4 spare bytes,
which we can reuse to store the sema field.

(32-bit alignment is still guaranteed because the array type was
changed to [3]uint32.)

Fixes #19149.

Change-Id: I9bc20e69e45e0e07fbf496080f3650e8be0d6e8d
Reviewed-on: https://go-review.googlesource.com/100515
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-03-15 09:56:25 +00:00
..
atomic runtime, sync/atomic: use NOFRAME on arm 2018-02-12 21:41:30 +00:00
cond.go all: change github.com issue links to golang.org 2017-11-04 04:13:41 +00:00
cond_test.go all: don't call t.Fatal from a goroutine 2016-11-15 15:13:48 +00:00
example_pool_test.go sync: add example for Pool 2016-11-10 05:32:14 +00:00
example_test.go
export_test.go sync: deflake TestPool and TestPoolNew 2017-06-28 22:02:07 +00:00
map.go sync: document when and when not to use Map 2018-01-04 20:13:20 +00:00
map_bench_test.go sync: release m.mu during (*RWMutexMap).Range callbacks in sync_test 2017-07-20 18:51:09 +00:00
map_reference_test.go sync: release m.mu during (*RWMutexMap).Range callbacks in sync_test 2017-07-20 18:51:09 +00:00
map_test.go sync: really test DeepCopyMap 2017-04-30 14:17:36 +00:00
mutex.go sync: throw, not panic, for unlock of unlocked mutex 2017-12-08 13:40:21 +00:00
mutex_test.go sync: throw, not panic, for unlock of unlocked mutex 2017-12-08 13:40:21 +00:00
once.go
once_test.go
pool.go sync: align poolLocal to CPU cache line size 2017-04-20 22:36:07 +00:00
pool_test.go sync: deflake TestPool and TestPoolNew 2017-06-28 22:02:07 +00:00
runtime.go sync: make Mutex more fair 2017-02-17 17:24:59 +00:00
runtime_sema_test.go sync: make Mutex more fair 2017-02-17 17:24:59 +00:00
rwmutex.go sync: enable profiling of RWMutex 2018-02-14 15:38:42 +00:00
rwmutex_test.go runtime: add read/write mutex type 2017-06-19 17:40:38 +00:00
waitgroup.go sync: make WaitGroup more space-efficient 2018-03-15 09:56:25 +00:00
waitgroup_test.go all: remove some unused parameters in test code 2017-04-25 14:38:10 +00:00