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

Tree @main (Download .tar.gz)

task.hpp @mainraw · 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;
  };

}