rwmutex

package
v1.6.3 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package rwmutex provides switch of concurrent safe feature for sync.RWMutex.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RWMutex

type RWMutex struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

RWMutex is a sync.RWMutex with a switch of concurrent safe feature.

func New

func New(safe ...bool) *RWMutex

New creates and returns a new *RWMutex. The parameter <safe> is used to specify whether using this mutex in concurrent-safety, which is false in default.

func (*RWMutex) IsSafe

func (mu *RWMutex) IsSafe() bool

func (*RWMutex) Lock

func (mu *RWMutex) Lock()

func (*RWMutex) RLock

func (mu *RWMutex) RLock()

func (*RWMutex) RUnlock

func (mu *RWMutex) RUnlock()

func (*RWMutex) Unlock

func (mu *RWMutex) Unlock()

Jump to

Keyboard shortcuts

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