A simple task scheduler in C++