sync

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var WaitGroup = star.Struct{
	TypeName:   "WaitGroup",
	Initialize: func() interface{} { return &sync.WaitGroup{} },
	Methods: map[string]star.Method{
		"Add": star.Method{
			Args: []starlark.Value{starlark.Int{}},
			Call: func(recv interface{}, args []interface{}) (resp []interface{}) {
				recv.(*sync.WaitGroup).Add(args[0].(int))
				return
			},
		},
		"Done": star.Method{
			Call: func(recv interface{}, args []interface{}) (resp []interface{}) {
				recv.(*sync.WaitGroup).Done()
				return
			},
		},
		"Wait": star.Method{
			Call: func(recv interface{}, args []interface{}) (resp []interface{}) {
				recv.(*sync.WaitGroup).Wait()
				return
			},
		},
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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