syncs: add AssertLocked

This allows us to check lock invariants.

It was proposed upstream and rejected in:
https://github.com/golang/go/issues/1366

Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
This commit is contained in:
Josh Bleecher Snyder
2020-09-08 15:55:18 -07:00
committed by Josh Bleecher Snyder
parent 158202dbb1
commit bf24d54143
3 changed files with 182 additions and 1 deletions

View File

@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package syncs contains addition sync types.
// Package syncs contains additional sync types and functionality.
package syncs
import "sync/atomic"