[2637] Added caching and locking function and test
Changed locking function and added test
Removed useless line
Removed useless line
Added line in test.py
Merge pull request #9 from dpolcyn/bug_2637

[2637] Added caching and locking function and test