C
Craig Rafferty
This has probably got a simple answer but I don't know what it is, any help
would be appreciated.
I am trying to create a thread to watch the value of an integer, there will
be set bounds that this integer must be in(ie >0 and < 50). I require that
when the value of the integer goes outside of these bounds, the calling
thread, in this case the main thread, will be notified.
To explain a little further, I am doing a project where I will use java to
simulate some sort of controller. My controller will allow taps to be turned
on to fill a tub and drainage to be activated. I had intended to model a
depth sensor using a thread to continually provide information on the water
depth, allowing the main program to control other things, when the maximum
depth is reached, the thread should interrupt the main program telling it.
This would save the main program from continually polling the depth sensor.
Thanks.
would be appreciated.
I am trying to create a thread to watch the value of an integer, there will
be set bounds that this integer must be in(ie >0 and < 50). I require that
when the value of the integer goes outside of these bounds, the calling
thread, in this case the main thread, will be notified.
To explain a little further, I am doing a project where I will use java to
simulate some sort of controller. My controller will allow taps to be turned
on to fill a tub and drainage to be activated. I had intended to model a
depth sensor using a thread to continually provide information on the water
depth, allowing the main program to control other things, when the maximum
depth is reached, the thread should interrupt the main program telling it.
This would save the main program from continually polling the depth sensor.
Thanks.