diff options
Diffstat (limited to 'syncs/mutex.go')
| -rw-r--r-- | syncs/mutex.go | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/syncs/mutex.go b/syncs/mutex.go index 8034e1712..78342ffc9 100644 --- a/syncs/mutex.go +++ b/syncs/mutex.go @@ -7,6 +7,10 @@ package syncs import "sync" +// MutexDebugging indicates whether the "ts_mutex_debug" build tag is set +// and mutex debugging is enabled. +const MutexDebugging = false + // Mutex is an alias for sync.Mutex. // // It's only not a sync.Mutex when built with the ts_mutex_debug build tag. @@ -20,4 +24,14 @@ 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) {} +func RequiresMutex(mu *Mutex) {} + +func RegisterMutex(mu *Mutex, name string) {} + +// ForkJoinGo is like go fn() but indicates that the goroutine +// is part of a fork-join parallelism pattern. +// +// This compiles to just "go fn()" in non-debug builds. +func ForkJoinGo(fn func()) { + go fn() +} |
