Source File
rwmutex.go
Belonging Package
sync
package sync
import (
)
type RWMutex struct {
w Mutex // held if there are pending writers
writerSem uint32 // semaphore for writers to wait for completing readers
readerSem uint32 // semaphore for readers to wait for completing writers
readerCount int32 // number of pending readers
readerWait int32 // number of departing readers
}
const rwmutexMaxReaders = 1 << 30
runtime_Semrelease(&.writerSem, false, 1)
}
}
:= atomic.AddInt32(&.readerCount, rwmutexMaxReaders)
if >= rwmutexMaxReaders {
race.Enable()
throw("sync: Unlock of unlocked RWMutex")
for := 0; < int(); ++ {
runtime_Semrelease(&.readerSem, false, 0)
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |