Added class Schedule for threads
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include "planemap.hpp"
|
||||
#include "idalloc.hpp"
|
||||
#include "animqueue.hpp"
|
||||
#include "sched.hpp"
|
||||
#include "source.hpp"
|
||||
#include "gui.hpp"
|
||||
#include "luasnap.hpp"
|
||||
@@ -46,10 +47,6 @@ public:
|
||||
|
||||
class World {
|
||||
public:
|
||||
// A thread ID appended to a place ID.
|
||||
//
|
||||
using ThreadPair = std::pair<int64_t, int64_t>;
|
||||
|
||||
// A lua intepreter with snapshot function.
|
||||
//
|
||||
LuaSnap lua_snap_;
|
||||
@@ -64,14 +61,12 @@ public:
|
||||
PlaneMap plane_map_;
|
||||
std::unordered_map<int64_t, Tangible> tangibles_;
|
||||
|
||||
// Thread queue.
|
||||
// Thread schedule: should include every thread, except
|
||||
// for the one currently-executing thread.
|
||||
//
|
||||
std::set<ThreadPair> thread_queue_;
|
||||
|
||||
void enqueue_thread(int64_t tid, int64_t place_id);
|
||||
void run_thread_queue();
|
||||
void run_thread(int64_t tid, int64_t place_id);
|
||||
Schedule thread_sched_;
|
||||
|
||||
void run_scheduled_threads(int64_t clk);
|
||||
public:
|
||||
// Constructor.
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user