Caching decorator with locks added

https://gist.github.com/kchomski/4b379548de35134bf380