go/src/sync
Russ Cox 645d07819b sync: add Mutex.TryLock, RWMutex.TryLock, RWMutex.TryRLock
Use of these functions is almost (but not) always a bad idea.

Very rarely they are necessary, and third-party implementations
(using a mutex and an atomic word, say) cannot integrate as well
with the race detector as implmentations in package sync itself.

Fixes #45435.

Change-Id: I0128ca48ef5e0a3b09c913f0f3a7ee5c56388000
Reviewed-on: https://go-review.googlesource.com/c/go/+/319769
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-10-29 17:13:13 +00:00
..
atomic sync/atomic: use a better first-store-in-progress marker 2021-10-26 20:41:32 +00:00
cond.go
cond_test.go all: add empty line between copyright header and package clause 2020-08-17 09:45:44 +00:00
example_pool_test.go
example_test.go sync: use example.com for url in ExampleWaitGroup 2021-10-09 14:53:12 +00:00
export_test.go
map.go sync: update misleading comment in map.go about entry type 2021-04-08 14:08:29 +00:00
map_bench_test.go sync: add new Map method LoadAndDelete 2020-02-25 14:31:55 +00:00
map_reference_test.go sync: add new Map method LoadAndDelete 2020-02-25 14:31:55 +00:00
map_test.go sync: delete dirty keys inside Map.LoadAndDelete 2020-08-24 20:05:41 +00:00
mutex.go sync: add Mutex.TryLock, RWMutex.TryLock, RWMutex.TryRLock 2021-10-29 17:13:13 +00:00
mutex_test.go sync: add Mutex.TryLock, RWMutex.TryLock, RWMutex.TryRLock 2021-10-29 17:13:13 +00:00
once.go sync: use 386 instead of x86-32 to refer to the 32 bit x86 architecture 2020-11-23 05:57:35 +00:00
once_test.go
pool.go runtime,sync: using fastrandn instead of modulo reduction 2021-10-07 14:01:52 +00:00
pool_test.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
poolqueue.go sync: fix typo in pooldequeue 2020-10-14 13:38:41 +00:00
runtime.go runtime: static lock ranking for the runtime (enabled by GOEXPERIMENT) 2020-04-07 21:51:03 +00:00
runtime2.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
runtime2_lockrank.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
runtime_sema_test.go
rwmutex.go sync: add Mutex.TryLock, RWMutex.TryLock, RWMutex.TryRLock 2021-10-29 17:13:13 +00:00
rwmutex_test.go sync: add Mutex.TryLock, RWMutex.TryLock, RWMutex.TryRLock 2021-10-29 17:13:13 +00:00
waitgroup.go sync: avoid a dynamic check in WaitGroup on 64-bit architectures 2021-10-19 18:21:38 +00:00
waitgroup_test.go sync: remove TestWaitGroupMisuse2 and TestWaitGroupMisuse3 2021-10-14 17:38:39 +00:00