git.haldean.org qb / b340f54 task.hpp
b340f54

Tree @b340f54 (Download .tar.gz)

task.hpp @b340f54raw · history · blame

#include <functional>
#include <mutex>
#include <thread>
#include <vector>

namespace qb
{

  using task = std::function<void(void)>;
  struct taskpool {
    static taskpool& get();
    void submit_async(const task &t);
    void submit_frame(const task &t);
    void frame();

  private:
    std::vector<task> _frametasks;
    std::mutex _locktasks;
  };

}