I got an problem, im programing an antihack program but i dont have idea how to repeat an function every x time like ThreadPool in java.
I think something like that:
while(true)
{
//Bad Procces its def before
if(badprocces())
ExitApplication(1);
}
//Other code there
But the other code not gona to be runned because the while dont allow it.
Else i think something like that:
while(true)
{
//Bad Procces its def before
if(badprocces())
ExitApplication(1);
if(anotherCheck())
ExitApplication(1);
}
But i guess isn’t the best way.
Its is possible? (Create a call ThreadPool like in java).
How to? (Whit example better)
Another Solution? (Better whit example)
Okay, that it’s all.
Thanks for read and for response.
if you want a timer like program you can make it easily like this, however I would encapsulate it in a class.
If you don’t have C++11 support than you can use the boost alternatives with lambdas.
I aren’t certain whether or not the automatic variable is strictly necessary.
It should be noted that this is not a thread pool but a single thread that loops with wait.