threading

package
v0.0.0-...-c864ae1 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2023 License: BSD-2-Clause, BSD-3-Clause, MIT Imports: 1 Imported by: 0

Documentation

Overview

threading supplies support in terms of forcing functions to run on the OS thread via a bound main goroutine (some behaviour, like OLE function invocations, demand this).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MainThreadChannel

type MainThreadChannel chan MainThreadFunction

MainThreadChannel defines a type of channel that should only be run on a goroutine locked to the OS thread.

func GetMainThreadChannel

func GetMainThreadChannel() MainThreadChannel

GetMainThreadChannel returns an internally initialised MainThreadChannel and locks the main goroutine to the OS thread. Behaviour is not guaranteed if this is not called from the main go routine.

func ResetMainThreadChannel

func ResetMainThreadChannel() MainThreadChannel

ResetMainThreadChannel returns an internally initialised MainThreadChannel and locks the main goroutine to the OS thread. Behaviour is not guaranteed if this is not called from the main go routine.

func (MainThreadChannel) Call

func (mtc MainThreadChannel) Call(mainThreadFunction MainThreadFunction)

Call allows the invocation of a MainThreadFunction on the main goroutine via this channel.

func (MainThreadChannel) Close

func (mtc MainThreadChannel) Close()

Close will close communication with this channel, and unlock the main goroutine from the OS thread.

func (MainThreadChannel) RunHandler

func (mtc MainThreadChannel) RunHandler()

RunHandler enters into a loop of receiving and executing functions for the channel. For expected behaviour, it should be the only function running on the main goroutine.

type MainThreadFunction

type MainThreadFunction func()

MainThreadFunction defines a function that should be run on the main goroutine

type MainThreadFunctionWrapper

type MainThreadFunctionWrapper func(mainThreadFunction MainThreadFunction)

Jump to

Keyboard shortcuts

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