mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2026-01-06 00:53:16 -06:00
add code comment
This commit is contained in:
parent
bd6a44ec04
commit
0c84a2a5c6
1 changed files with 6 additions and 0 deletions
|
|
@ -30,11 +30,17 @@ import (
|
||||||
"github.com/tetratelabs/wazero"
|
"github.com/tetratelabs/wazero"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// ffmpreg is a concurrency-safe pointer
|
||||||
|
// to our necessary WebAssembly runtime
|
||||||
|
// and compiled ffmpreg module instance.
|
||||||
var ffmpreg atomic.Pointer[struct {
|
var ffmpreg atomic.Pointer[struct {
|
||||||
run wazero.Runtime
|
run wazero.Runtime
|
||||||
mod wazero.CompiledModule
|
mod wazero.CompiledModule
|
||||||
}]
|
}]
|
||||||
|
|
||||||
|
// initWASM safely prepares new WebAssembly runtime
|
||||||
|
// and compiles ffmpreg module instance, if the global
|
||||||
|
// pointer has not been already. else, is a no-op.
|
||||||
func initWASM(ctx context.Context) error {
|
func initWASM(ctx context.Context) error {
|
||||||
if ffmpreg.Load() != nil {
|
if ffmpreg.Load() != nil {
|
||||||
return nil
|
return nil
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue