gsync

package
v0.0.0-...-986f64f Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2023 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

本包提供实现并发安全的工具

Index

Constants

This section is empty.

Variables

View Source
var (
	//读锁没有被持有
	Noreadlock error = errors.New("No read lock")
	//写锁没有被持有
	Nowritelock error = errors.New("No write lock")
)

读写锁错误

Functions

This section is empty.

Types

type LMrwmutex

type LMrwmutex = LowMemory_rwMutex

使用内存少的读写锁,不能复制

func (*LMrwmutex) Lock

func (m *LMrwmutex) Lock()

获取写锁

func (*LMrwmutex) RLock

func (m *LMrwmutex) RLock()

获取读锁

func (*LMrwmutex) RUnlock

func (m *LMrwmutex) RUnlock()

释放读锁

func (*LMrwmutex) Unlock

func (m *LMrwmutex) Unlock()

释放写锁

type LowMemory_rwMutex

type LowMemory_rwMutex struct {
	// contains filtered or unexported fields
}

使用内存少的读写锁,不能复制

type Rwlock

type Rwlock interface {
	sync.Locker
	RLock()
	RUnlock()
}

读写锁接口

Jump to

Keyboard shortcuts

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