You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice if RUnlock() panicked if called when the mutex is not read locked,
similar to how Unlock() panics when the mutex is not write locked. As it is, bugs
related to mismatched rlocking are harder to find. The documentation states that
"It is a run-time error if rw is not locked for reading on entry to RUnlock."
which I interpret as we intended this to panic.
Go v1.2.1
The program:
http://play.golang.org/p/GmAqwC5WJo
Now prints:
Read locked
Also, write locked
While I would expect it to panic on line 10.
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: