check if thread running at same time code example Example: java check if thread is running Thread.isAlive()