You are storing the thread in a field. If the method is called in two threads, the readThread.start()
can be called twice for the same thread. You need to ensure readCommand is not called multiple times and perhaps not start the readThread again if its already running. e.g. you can synchronized the method and check readThread before you start.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…