- make use of lock() and release() function instead of directly accessing
  lock handle in close() function
- add optional timeout parameter to lock() function