projects
/
cdsspec-compiler.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ec6458e
)
schedule: make 'current' a private member of the scheduler
author
Brian Norris
<banorris@uci.edu>
Thu, 15 Mar 2012 05:56:30 +0000
(22:56 -0700)
committer
Brian Norris
<banorris@uci.edu>
Thu, 15 Mar 2012 05:56:30 +0000
(22:56 -0700)
schedule.cc
patch
|
blob
|
history
schedule.h
patch
|
blob
|
history
diff --git
a/schedule.cc
b/schedule.cc
index 687d30612d2e2c3549caf4e922210885fad94941..c02ca62b12a16cd1c07d58ffd20f1ac383b57181 100644
(file)
--- a/
schedule.cc
+++ b/
schedule.cc
@@
-5,8
+5,6
@@
#include "common.h"
#include "model.h"
#include "common.h"
#include "model.h"
-struct thread *current;
-
void DefaultScheduler::add_thread(struct thread *t)
{
DEBUG("thread %d\n", t->id);
void DefaultScheduler::add_thread(struct thread *t)
{
DEBUG("thread %d\n", t->id);
@@
-15,17
+13,13
@@
void DefaultScheduler::add_thread(struct thread *t)
struct thread *DefaultScheduler::next_thread(void)
{
struct thread *DefaultScheduler::next_thread(void)
{
- struct thread *t;
-
if (queue.empty())
return NULL;
if (queue.empty())
return NULL;
- t = queue.front();
+
curren
t = queue.front();
queue.pop_front();
queue.pop_front();
- current = t;
-
- return t;
+ return current;
}
struct thread *DefaultScheduler::get_current_thread(void)
}
struct thread *DefaultScheduler::get_current_thread(void)
diff --git
a/schedule.h
b/schedule.h
index 762e16818ed220dfc3a313a0b297638d7e9bfddd..aa291ef8cd788872f14adce2f7199a6d3186f1de 100644
(file)
--- a/
schedule.h
+++ b/
schedule.h
@@
-20,6
+20,7
@@
public:
struct thread * get_current_thread(void);
private:
std::list<struct thread *> queue;
struct thread * get_current_thread(void);
private:
std::list<struct thread *> queue;
+ struct thread *current;
};
#endif /* __SCHEDULE_H__ */
};
#endif /* __SCHEDULE_H__ */