Hi all,
I'm stuck with my application with regards to starting and stopping a timer based on whether a thread is finished or not.
In my main program there is a timer and when it is triggered it:
- stops the timer
- spawns a thread which goes about pinging IP addresses and updating a database
The problem is that when the PingThread finishes I want to start the timer again. Thats where the problem lies because I could not find the correct pace for that.
Is it viabale that I spawn a second thread which basically waits for the PingThread to finish and then call the timer.start() again from that thread OR would it be smarter to just start the timer again in the PingThread when it finishes...
Additional question, can I reach the timer.start() method from the original PingThread or not?
I'm getting really confused here...
Hope to get some fresh views on the subject.
Thanks!
- Raenius
"Free will...is an illusion"
I'm stuck with my application with regards to starting and stopping a timer based on whether a thread is finished or not.
In my main program there is a timer and when it is triggered it:
- stops the timer
- spawns a thread which goes about pinging IP addresses and updating a database
The problem is that when the PingThread finishes I want to start the timer again. Thats where the problem lies because I could not find the correct pace for that.
Is it viabale that I spawn a second thread which basically waits for the PingThread to finish and then call the timer.start() again from that thread OR would it be smarter to just start the timer again in the PingThread when it finishes...
Additional question, can I reach the timer.start() method from the original PingThread or not?
I'm getting really confused here...
Hope to get some fresh views on the subject.
Thanks!
- Raenius
"Free will...is an illusion"