Is there a way to create a timer (say, to 10 seconds) on a different thread? I mean, I know how to use CreateThread() and I know how to create/use timers. The problem I have is that the new thread cannot receive a callback function.
For those that will inevitably ask "why do you want to do this?" the answer is because i have to do it this way. it is part of a bigger program that can't at this specific part of the code use callback functions. that's all.
Is there any way to achieve this?
code is appreciated.
Thanks!
EDIT:
A better explanation of the problem: My application consist of two separate programs. The main program (visible, interface for the user) and another doing the hard work in the background (sort of like a daemon). The background process need to finishing writing to the DB and closing a lot of little files before exiting. The main application send a "we're done" message to that background process. Upon receiving this the background process returns the current status and exists. Now, I need to add the following: upon receiving the message it returns a status and triggers a timer that will wait X amount of time on another thread, in the meantime the background process closes all the DB connections and files. If the timer reached 0 then and the background process is still alive then it terminates it. If the background process closed all the db and files then the thread (and timer) will die before reaching 0 as the application terminates normally.
Is this better?