concurrent

package
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2018 License: Apache-2.0 Imports: 5 Imported by: 18

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AtomicInteger

type AtomicInteger int32

AtomicInteger is a int32 wrapper fo atomic

func (*AtomicInteger) DecrementAndGet

func (i *AtomicInteger) DecrementAndGet() int32

DecrementAndGet decrement wrapped int32 with 1 and return new value.

func (*AtomicInteger) Get

func (i *AtomicInteger) Get() int32

Get current value

func (*AtomicInteger) GetAndDecrement

func (i *AtomicInteger) GetAndDecrement() int32

GetAndDecrement decrement wrapped int32 with 1 and return old value.

func (*AtomicInteger) GetAndIncrement

func (i *AtomicInteger) GetAndIncrement() int32

GetAndIncrement increment wrapped int32 with 1 and return old value.

func (*AtomicInteger) IncrementAndGet

func (i *AtomicInteger) IncrementAndGet() int32

IncrementAndGet increment wrapped int32 with 1 and return new value.

type TimeoutCond

type TimeoutCond struct {
	L sync.Locker
	// contains filtered or unexported fields
}

TimeoutCond is a sync.Cond improve for support wait timeout.

func NewTimeoutCond

func NewTimeoutCond(l sync.Locker) *TimeoutCond

NewTimeoutCond return a new TimeoutCond

func (*TimeoutCond) HasWaiters

func (cond *TimeoutCond) HasWaiters() bool

HasWaiters queries whether any goroutine are waiting on this condition

func (*TimeoutCond) Interrupt

func (cond *TimeoutCond) Interrupt()

Interrupt goroutine wait on this TimeoutCond

func (*TimeoutCond) Signal

func (cond *TimeoutCond) Signal()

Signal wakes one goroutine waiting on c, if there is any.

func (*TimeoutCond) Wait

func (cond *TimeoutCond) Wait(ctx context.Context) bool

Wait waits for a signal, or for the context do be done. Returns true if signaled.

Jump to

Keyboard shortcuts

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