handle sleeping behavior of lthread_sleep(0) inside lthread_sleep