MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / Run

Method Run

internal/goman/task_group.go:29–40  ·  view source on GitHub ↗
(f func())

Source from the content-addressed store, hash-verified

27}
28
29func (this *TaskGroup) Run(f func()) {
30 this.wg.Add(1)
31 go func() {
32 defer this.wg.Done()
33
34 this.semi <- zero.Zero{}
35
36 f()
37
38 <-this.semi
39 }()
40}
41
42func (this *TaskGroup) Wait() {
43 this.wg.Wait()

Callers 1

TestNewTaskGroupFunction · 0.45

Calls 2

DoneMethod · 0.80
AddMethod · 0.65

Tested by 1

TestNewTaskGroupFunction · 0.36