@xiangli-cmu The deferred unlock is run after the value of `s.state` is returned.

Here's a playground example: http://play.golang.org/p/3grXbtVzsT