java check if thread is waiting code example Example: java check if thread is running Thread.isAlive()