unlock

package module
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2021 License: MIT Imports: 3 Imported by: 2

README

Unlock

Lock Free algorithms and Lock

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Queue

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

func NewQueue

func NewQueue() *Queue

func (*Queue) DeQueue

func (q *Queue) DeQueue() (unsafe.Pointer, bool)

func (*Queue) EnQueue

func (q *Queue) EnQueue(x unsafe.Pointer) bool

func (Queue) Len

func (q Queue) Len() int64

type RingBuffer

type RingBuffer struct {
	TLock
	// contains filtered or unexported fields
}

func NewRingBuffer

func NewRingBuffer(size int) *RingBuffer

func (*RingBuffer) DeQueue

func (b *RingBuffer) DeQueue() unsafe.Pointer

func (*RingBuffer) DeQueueMany added in v1.2.1

func (b *RingBuffer) DeQueueMany(dst []unsafe.Pointer)

func (*RingBuffer) EnQueue

func (b *RingBuffer) EnQueue(x unsafe.Pointer)

func (*RingBuffer) EnQueueMany added in v1.2.1

func (b *RingBuffer) EnQueueMany(x []unsafe.Pointer)

type Stack

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

Stack: Treiber's stack

func NewStack

func NewStack() *Stack

func (Stack) Len

func (s Stack) Len() int64

func (*Stack) Pop

func (s *Stack) Pop() (unsafe.Pointer, bool)

func (*Stack) Push

func (s *Stack) Push(x unsafe.Pointer)

type TLock

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

func (*TLock) Lock

func (l *TLock) Lock()

Lock acquires the lock

func (*TLock) TryLock

func (l *TLock) TryLock() (locked bool)

TryLock tries to acquire the lock

func (*TLock) Unlock

func (l *TLock) Unlock()

Unlock releases the lock

Jump to

Keyboard shortcuts

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