Use a boolean instead as thread's state