Closed qpfiffer closed 9 years ago
@Xe It makes sense to me, since defer will happen regardless of exceptions/panics/whatever they're called in go.
http://lk4d4.darth.io/posts/defer/
I'm going to merge this in because this is a known thing in Golang. Besides, if we're throwing Errors or whatever from the C API then things are royally fucked anyway.
Was reading this thread when somebody mentioned that using
defer
is slower than explicitly unlocking, so I did a small rewrite and ran some tests of my own:Sure enough, the lack of defer is faster. I'll leave this open for a little while for any comments on why we should use defer or otherwise. Code review as well would be awesome.