Added lock/unlock functions to the library.