Issue #21758:implement locking
Merge pull request #291 from garyhgohoos/21758

Issue #21758:implement locking