| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
package stdlib |
| 7 |
|
| 8 |
import ( |
| 9 |
"reflect" |
| 10 |
"sync" |
| 11 |
) |
| 12 |
|
| 13 |
func init() { |
| 14 |
Symbols["sync/sync"] = map[string]reflect.Value{ |
| 15 |
|
| 16 |
"NewCond": reflect.ValueOf(sync.NewCond), |
| 17 |
"OnceFunc": reflect.ValueOf(sync.OnceFunc), |
| 18 |
|
| 19 |
|
| 20 |
"Cond": reflect.ValueOf((*sync.Cond)(nil)), |
| 21 |
"Locker": reflect.ValueOf((*sync.Locker)(nil)), |
| 22 |
"Map": reflect.ValueOf((*sync.Map)(nil)), |
| 23 |
"Mutex": reflect.ValueOf((*sync.Mutex)(nil)), |
| 24 |
"Once": reflect.ValueOf((*sync.Once)(nil)), |
| 25 |
"Pool": reflect.ValueOf((*sync.Pool)(nil)), |
| 26 |
"RWMutex": reflect.ValueOf((*sync.RWMutex)(nil)), |
| 27 |
"WaitGroup": reflect.ValueOf((*sync.WaitGroup)(nil)), |
| 28 |
|
| 29 |
|
| 30 |
"_Locker": reflect.ValueOf((*_sync_Locker)(nil)), |
| 31 |
} |
| 32 |
} |
| 33 |
|
| 34 |
|
| 35 |
type _sync_Locker struct { |
| 36 |
IValue interface{} |
| 37 |
WLock func() |
| 38 |
WUnlock func() |
| 39 |
} |
| 40 |
|
| 41 |
func (W _sync_Locker) Lock() { W.WLock() } |
| 42 |
func (W _sync_Locker) Unlock() { W.WUnlock() } |