Added try_lock method