I am working with threads. However when I try to start a thread, I get a Exception. In concrete java.lang.IllegalThreadStateException. My code is:
public void readCommand() {
readThread = new Thread("Thread for reading") {
public void run() {
while (running) {
readBuffer = usbservice.receiveData();
put(readBuffer);
}
}
};
readThread.start();
}
What could the problem be?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…