stack

package
v0.4.0-alpha Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LockFreeStack

type LockFreeStack[T any] interface {
	Push(T)
	Pop() T
}

LockFreeStack is an interface representing a thread-safe, lock-free stack.

type Stack

type Stack[T any] struct {
	// contains filtered or unexported fields
}

func NewLockFreeStack

func NewLockFreeStack[T any]() *Stack[T]

NewStack creates a new lock-free queue.

func (*Stack[T]) Pop

func (s *Stack[T]) Pop() T

Pop pops value from the top of the stack.

func (*Stack[T]) Push

func (s *Stack[T]) Push(v T)

Push pushes a value on top of the stack.

Jump to

Keyboard shortcuts

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