Switched to scoped lock to make it exception safe. shutupmichael
Removed un-needed unlocks
Merge pull request #288 from scj7t4/Issue258

TESTING GITHUB BEHAVIOR IGNORE