Added a sleep mechanism that avoids busy waiting