Use wait/notify to stop sleeping when a preference has changed.