I am simulating the enviornment like this. Two threads are running, one
is reading data from serial port while another one is receiving interrupt
from keyboard. During interrupt, the program will do some work else. After
one thread will continuously read data. I’m wondering how to write it,
specially how to write receive interrupt in one thread with
the part of event of interrupt handler. Can I get some examples on it?