MCPcopy Create free account
hub / github.com/imgproxy/imgproxy / TestLatchMultipleReleases

Function TestLatchMultipleReleases

asyncbuffer/latch_test.go:115–130  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

113}
114
115func TestLatchMultipleReleases(t *testing.T) {
116 latch := asyncbuffer.NewLatch()
117
118 // Release multiple times should be safe
119 latch.Release()
120 latch.Release()
121 latch.Release()
122
123 // Should still be able to wait
124 select {
125 case <-asyncbuffer.LatchDone(latch):
126 // Expected - channel should be ready
127 default:
128 t.Fatal("Latch should be released")
129 }
130}

Callers

nothing calls this directly

Calls 3

ReleaseMethod · 0.95
NewLatchFunction · 0.92
LatchDoneFunction · 0.92

Tested by

no test coverage detected