MCPcopy Create free account
hub / github.com/google/pprof / parallel

Function parallel

profile/profile_test.go:1895–1905  ·  view source on GitHub ↗

parallel runs n copies of fn in parallel.

(n int, fn func())

Source from the content-addressed store, hash-verified

1893
1894// parallel runs n copies of fn in parallel.
1895func parallel(n int, fn func()) {
1896 var wg sync.WaitGroup
1897 wg.Add(n)
1898 for i := 0; i < n; i++ {
1899 go func() {
1900 fn()
1901 wg.Done()
1902 }()
1903 }
1904 wg.Wait()
1905}
1906
1907func TestThreadSafety(t *testing.T) {
1908 src := testProfile1.Copy()

Callers 1

TestThreadSafetyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…