MCPcopy Index your code
hub / github.com/goinaction/code / WriteUnlock

Method WriteUnlock

chapter7/patterns/semaphore/semaphore.go:243–249  ·  view source on GitHub ↗

WriteUnlock releases the write lock and allows reads to occur.

()

Source from the content-addressed store, hash-verified

241
242// WriteUnlock releases the write lock and allows reads to occur.
243func (rw *readerWriter) WriteUnlock() {
244 // Release all the buffers back into the semaphore channel.
245 rw.readerControl.Release(rw.maxReads)
246
247 // Release the write lock.
248 rw.write.Done()
249}
250
251// Acquire attempts to secure the specified number of buffers from the
252// semaphore channel.

Callers 1

performWriteMethod · 0.95

Calls 1

ReleaseMethod · 0.45

Tested by

no test coverage detected