gotour29

package
v0.5.22 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Mutex

func Mutex() error

Mutex は、 Tour of Go - sync.Mutex (https://tour.golang.org/concurrency/9) の サンプルです。

Types

type Incrementer

type Incrementer interface {
	// Increment -- 加算します.
	Increment(wg *sync.WaitGroup)
}

Incrementer -- 何かを加算する振る舞いを持ちます.

func NewNotSafeCounter

func NewNotSafeCounter() Incrementer

NewNotSafeCounter -- 安全ではないカウンターを返します.

func NewSafeCounter

func NewSafeCounter() Incrementer

NewSafeCounter -- 安全なカウンターを返します.

type NotSafeCounter

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

NotSafeCounter -- 安全ではないカウンター

func (*NotSafeCounter) Increment

func (c *NotSafeCounter) Increment(wg *sync.WaitGroup)

Increment -- 加算します.

func (*NotSafeCounter) String

func (c *NotSafeCounter) String() string

type SafeCounter

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

SafeCounter -- 安全なカウンター

func (*SafeCounter) Increment

func (c *SafeCounter) Increment(wg *sync.WaitGroup)

Increment -- 加算します.

func (*SafeCounter) String

func (c *SafeCounter) String() string

Jump to

Keyboard shortcuts

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