add lock() and unlock()
Merge pull request #29 from TBEDP/lock

add lock() and unlock()