MCPcopy
hub / github.com/tinygo-org/tinygo / acquire

Function acquire

testdata/goroutines.go:95–102  ·  view source on GitHub ↗
(m *sync.Mutex, wg *sync.WaitGroup)

Source from the content-addressed store, hash-verified

93}
94
95func acquire(m *sync.Mutex, wg *sync.WaitGroup) {
96 m.Lock()
97 wg.Done()
98 println("acquired mutex from goroutine")
99 time.Sleep(2 * time.Millisecond)
100 println("releasing mutex from goroutine")
101 m.Unlock()
102}
103
104func sub() {
105 println("sub 1")

Callers 1

mainFunction · 0.85

Calls 4

DoneMethod · 0.80
LockMethod · 0.65
SleepMethod · 0.65
UnlockMethod · 0.65

Tested by

no test coverage detected