syncutil

package module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 9, 2020 License: MIT Imports: 5 Imported by: 0

README

syncutil

A collection of utility functions for Go synchronization.

LoggingRWMutex

The LoggingRWMutex implements the same methods as sync.RWMutex but logs the stack trace before each operation.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LoggingRWMutex

type LoggingRWMutex struct {

	// Optional name used during print.
	Name string
	// contains filtered or unexported fields
}

LoggingRWMutex wraps a sync.RWMutex and logs to STDERR on every lock/unlock call.

func (*LoggingRWMutex) Lock

func (rw *LoggingRWMutex) Lock()

Lock logs to STDERR that a lock is being obtained and then obtains the lock.

func (*LoggingRWMutex) RLock

func (rw *LoggingRWMutex) RLock()

RLock logs to STDERR that a read lock is being obtained and then obtains the read lock.

func (*LoggingRWMutex) RLocker

func (rw *LoggingRWMutex) RLocker() sync.Locker

RLocker returns the underlying mutex's locker.

func (*LoggingRWMutex) RUnlock

func (rw *LoggingRWMutex) RUnlock()

RUnlock logs to STDERR that a read lock is being released and then releases the read lock.

func (*LoggingRWMutex) Unlock

func (rw *LoggingRWMutex) Unlock()

Unlock logs to STDERR that a lock is being released and then releases the lock.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL