thread

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DaemonStart

func DaemonStart()

func GetGID

func GetGID() uint64

获取GOROUTINE的ID

Types

type Daemon

type Daemon interface {
	Done()
}

type Semaphore

type Semaphore struct {
	Threads chan int
	Wg      sync.WaitGroup
}

Semaphore implements the signal mechanism management

func NewSemaphore

func NewSemaphore(n int) *Semaphore

NewSemaphore returns a new semaphore

func (*Semaphore) P

func (sem *Semaphore) P()

P is a primitive operation that requests the allocation of a unit resource

func (*Semaphore) V

func (sem *Semaphore) V()

V is a primitive operation that releases a unit of resources

func (*Semaphore) Wait

func (sem *Semaphore) Wait()

Wait waits for all unit resources to be released

Jump to

Keyboard shortcuts

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