spinlock

package
v0.0.0-...-3f1f8f2 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: Apache-2.0, BSD-3-Clause, MIT Imports: 2 Imported by: 0

Documentation

Overview

Package spinlock provides spinlock implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Spinlock

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

A Spinlock is a spin exclusion lock, just like kernel spinlock. value:

0, unlocked
1, locked

func (*Spinlock) Lock

func (s *Spinlock) Lock()

Lock locks the spinlock.

func (*Spinlock) LockYield

func (s *Spinlock) LockYield()

LockYield locks the spinlock. If the lock is not available, it can yield the CPU.

func (*Spinlock) Unlock

func (s *Spinlock) Unlock()

Unlock unlocks the spinlock.

Jump to

Keyboard shortcuts

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