projects
/
cdsspec-compiler.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
major rewrite - 'struct thread' replaced with internal 'class Thread'
[cdsspec-compiler.git]
/
schedule.cc
1
#include "threads_internal.h"
2
#include "schedule.h"
3
#include "common.h"
4
#include "model.h"
5
6
void Scheduler::add_thread(Thread *t)
7
{
8
DEBUG("thread %d\n", t->get_id());
9
queue.push(t);
10
}
11
12
Thread *Scheduler::next_thread(void)
13
{
14
if (queue.empty())
15
return NULL;
16
17
current = queue.front();
18
queue.pop();
19
20
return current;
21
}
22
23
Thread *Scheduler::get_current_thread(void)
24
{
25
return current;
26
}