
block SIGHUP, SIGINT, SIGTERM in all threads, except sensorporthandler

main thread does a join on SensorPortHandler

SensorPortHandler thread receives signal, interrupts self,
returns from run (possibly after timeout.  Return something
indicating whether to restart (HUP means restart, others mean die).
Also restart on socket write error.

main thread returns from join on SensorPortHandler

main thread interrupts RawSamplerThread
interrupt function of RawSamplerThread, sets interrupt variable, and
signals samples available.

Also, if RawSampleHandler gets a hard error on socket write,
then we should restart. Avoid rapid restart loops . run returns
indicator of restart.

main thread joins RawSamplerThread

interrupt and send signal to rserial thread. Make sure it causes listen
to return

join rserial thread

if sig is HUP, go back to beginning, otherwise exit




