waitstate in thread