projects
/
c11tester.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
model: refactor "get next thread" code
[c11tester.git]
/
schedule.h
diff --git
a/schedule.h
b/schedule.h
index e81ea935cc961b1568a25e095ae0ca4a6c9813bd..664b2d245bea0b05a3f072d9c0eb75146bdfaf0f 100644
(file)
--- a/
schedule.h
+++ b/
schedule.h
@@
-1,4
+1,6
@@
-/* -*- Mode: C; indent-tabs-mode: t -*- */
+/** @file schedule.h
+ * @brief Thread scheduler.
+ */
#ifndef __SCHEDULE_H__
#define __SCHEDULE_H__
#ifndef __SCHEDULE_H__
#define __SCHEDULE_H__
@@
-9,17
+11,25
@@
/* Forward declaration */
class Thread;
/* Forward declaration */
class Thread;
+/** @brief The Scheduler class performs the mechanics of Thread execution
+ * scheduling. */
class Scheduler {
public:
Scheduler();
void add_thread(Thread *t);
void remove_thread(Thread *t);
class Scheduler {
public:
Scheduler();
void add_thread(Thread *t);
void remove_thread(Thread *t);
- Thread * next_thread(void);
- Thread * get_current_thread(void);
- void print();
- MEMALLOC
+ void wait(Thread *wait, Thread *join);
+ void wake(Thread *t);
+ Thread * next_thread(Thread *t);
+ Thread * get_current_thread() const;
+ void print() const;
+
+ SNAPSHOTALLOC
private:
private:
- std::list<Thread *, MyAlloc< Thread * > > readyList;
+ /** The list of available Threads that are not currently running */
+ std::list<Thread *> readyList;
+
+ /** The currently-running Thread */
Thread *current;
};
Thread *current;
};