work on locking and waiting for operation on cache close