rumutex

package module
Version: v0.0.0-...-a2fa655 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2016 License: MIT Imports: 2 Imported by: 0

README

A Go (golang) implementation of an upgradable RW lock.

Documentation

Overview

Package rumutex implements an upgradable reader/writer mutual exclusion lock.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RUMutex

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

An RUMutex is an upgradable reader/writer mutual exclusion lock. The lock can be held by an arbitrary number of readers or a single writer.

func (*RUMutex) Downgrade

func (ru *RUMutex) Downgrade()

Downgrade downgrades a write locked ru back to shared reading.

func (*RUMutex) RLock

func (ru *RUMutex) RLock()

RLock locks ru for shared reading.

func (*RUMutex) RUnlock

func (ru *RUMutex) RUnlock()

RUnlock unlocks a read locked ru.

func (*RUMutex) Unlock

func (ru *RUMutex) Unlock()

Unlock unlocks a write locked ru.

func (*RUMutex) Upgrade

func (ru *RUMutex) Upgrade() bool

Upgrade attempts to upgrade a read locked ru to exclusive writing. Returns false if the lock is already being upgraded.

Source Files

Jump to

Keyboard shortcuts

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