Hi there,

I was wondering if the code ever panics and we have a if recover := recover(); 
recover != nil {

in a defer func and we are using sync.RWMutexes which do not have a defer 
to unlock for example.

What kinds of things can happen if the code unexpectedly panics when we are 
in a Lock() in the code and then something panics before it Unlocks.  My 
defer funcs almost never unlock the syncRW mutexes or any RLock()'s that 
were called to unlock.

Should maybe if we are in the recover() block should we then call Unlock() 
or RUnlock on all sync.RWMutex's that the function is recovering from?  How 
would one know if you are in a lock or not if we made it far enough to open 
the lock to know which ones to unlock if it truly keeps the lock open?

Since we rarely get panics and we are dealing with some deadlocks, I am 
asking myself this question and dont really know how to test it easily to 
verify what really happens.

-- 
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.

Reply via email to