mirror of
https://github.com/tailscale/tailscale.git
synced 2025-12-24 01:26:39 +00:00
syncs: add means of declare locking assumptions for debug mode validation
Updates #17852 Change-Id: I42a64a990dcc8f708fa23a516a40731a19967aba Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
committed by
Brad Fitzpatrick
parent
3f9f0ed93c
commit
74ed589042
@@ -16,3 +16,8 @@ type Mutex = sync.Mutex
|
||||
//
|
||||
// It's only not a sync.RWMutex when built with the ts_mutex_debug build tag.
|
||||
type RWMutex = sync.RWMutex
|
||||
|
||||
// RequiresMutex declares the caller assumes it has the given
|
||||
// mutex held. In non-debug builds, it's a no-op and compiles to
|
||||
// nothing.
|
||||
func RequiresMutex(mu *sync.Mutex) {}
|
||||
|
||||
Reference in New Issue
Block a user