File: go1_21_sync.go

package info (click to toggle)
golang-github-traefik-yaegi 0.16.1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 24,608 kB
  • sloc: sh: 457; makefile: 39
file content (46 lines) | stat: -rw-r--r-- 1,129 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Code generated by 'yaegi extract sync'. DO NOT EDIT.

//go:build go1.21 && !go1.22
// +build go1.21,!go1.22

package stdlib

import (
	"reflect"
	"sync"
)

func init() {
	Symbols["sync/sync"] = map[string]reflect.Value{
		// function, constant and variable definitions
		"NewCond":  reflect.ValueOf(sync.NewCond),
		"OnceFunc": reflect.ValueOf(sync.OnceFunc),

		// type definitions
		"Cond":      reflect.ValueOf((*sync.Cond)(nil)),
		"Locker":    reflect.ValueOf((*sync.Locker)(nil)),
		"Map":       reflect.ValueOf((*sync.Map)(nil)),
		"Mutex":     reflect.ValueOf((*sync.Mutex)(nil)),
		"Once":      reflect.ValueOf((*sync.Once)(nil)),
		"Pool":      reflect.ValueOf((*sync.Pool)(nil)),
		"RWMutex":   reflect.ValueOf((*sync.RWMutex)(nil)),
		"WaitGroup": reflect.ValueOf((*sync.WaitGroup)(nil)),

		// interface wrapper definitions
		"_Locker": reflect.ValueOf((*_sync_Locker)(nil)),
	}
}

// _sync_Locker is an interface wrapper for Locker type
type _sync_Locker struct {
	IValue  interface{}
	WLock   func()
	WUnlock func()
}

func (W _sync_Locker) Lock() {
	W.WLock()
}
func (W _sync_Locker) Unlock() {
	W.WUnlock()
}