Adding infinite sleep and nonblocking lock