sync

package
v0.0.0-...-8e5a076 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 License: GPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fence

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

func NewFence

func NewFence(device *device.Device, name string, signaled bool) *Fence

func (*Fence) Destroy

func (f *Fence) Destroy()

func (*Fence) Done

func (f *Fence) Done() bool

func (*Fence) Ptr

func (f *Fence) Ptr() core1_0.Fence

func (*Fence) Reset

func (f *Fence) Reset()

func (*Fence) Wait

func (f *Fence) Wait()

type FencePool

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

func NewFencePool

func NewFencePool(device *device.Device, name string) *FencePool

func (*FencePool) Destroy

func (w *FencePool) Destroy()

Destroy cleans up all fences in the pool. It waits (1 sec) for all fences to be signaled and runs their callbacks.

func (*FencePool) Next

func (w *FencePool) Next() *Fence

Next returns a fence from the pool. Until the fence is added back to the pool, the caller has ownership of it. If there are no fences available, a new one is allocated.

func (*FencePool) Poll

func (w *FencePool) Poll()

Poll checks all fences in the pool and runs their callbacks if they are done. If a fence is done, it is returned to the pool.

func (*FencePool) Watch

func (w *FencePool) Watch(fence *Fence, callback func())

Watch adds a fence to the pool and sets a callback to run when the fence is done. The callback is run in the same goroutine as the Poll call.

type Mutex

type Mutex = sync.Mutex

type Semaphore

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

func NewSemaphore

func NewSemaphore(dev *device.Device, name string) *Semaphore

func NewSemaphoreArray

func NewSemaphoreArray(dev *device.Device, name string, count int) []*Semaphore

func (*Semaphore) Destroy

func (s *Semaphore) Destroy()

func (*Semaphore) Name

func (s *Semaphore) Name() string

func (Semaphore) Ptr

func (s Semaphore) Ptr() core1_0.Semaphore

Jump to

Keyboard shortcuts

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