I get it now. Thanks for your time. On Monday, October 3, 2016 at 10:55:34 PM UTC+2, Caleb Spare wrote: > > It's explained in the text afterwards: > > "This is to ensure that the lock eventually becomes available; a > blocked Lock call excludes new readers from acquiring the lock." > > So if you RLock and then another goroutine tries to Lock, you might > not be able to RLock again until the first read lock is RUnlocked (and > after the Lock+Unlock). > > -Caleb > > On Mon, Oct 3, 2016 at 1:50 PM, Roberto Zanotto <roby...@gmail.com > <javascript:>> wrote: > > Hi everyone. > > > > I thought I understood clearly how an RWMutex is supposed to work, but > the > > documentation is giving me some troubles. > > It says: "The lock can be held by an arbitrary number of readers" > > which is fine by me, but then the following statement seems to > contradict > > it: > > "If a goroutine holds a RWMutex for reading, it must not expect this or > any > > other goroutine to be able to also take the read lock until the first > read > > lock is released.". > > Am I missing something? > > > > -- > > You received this message because you are subscribed to the Google > Groups > > "golang-nuts" group. > > To unsubscribe from this group and stop receiving emails from it, send > an > > email to golang-nuts...@googlegroups.com <javascript:>. > > For more options, visit https://groups.google.com/d/optout. >
-- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.