package
Version:
v0.0.19
Opens a new window with list of versions in this module.
Published: Jul 25, 2024
License: MIT
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Stack implements lock-free freelist based stack.
s := New()
s.Push(1)
s.Push(2)
s.Push(3)
fmt.Println(s.Pop())
fmt.Println(s.Pop())
fmt.Println(s.Pop())
Output:
3
2
1
New creates a new lock-free queue.
func (s *Stack) Pop() interface{}
Pop pops value from the top of the stack.
func (s *Stack) Push(v interface{})
Push pushes a value on top of the stack.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.