git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Support to multi-threading and pthread interface (POSIX.1-2008) (#23)
[lunaix-os.git]
/
lunaix-os
/
includes
/
lunaix
/
sched.h
diff --git
a/lunaix-os/includes/lunaix/sched.h
b/lunaix-os/includes/lunaix/sched.h
index f31eab52daa9ce7ddc34b2d220812b64c9a27985..c011adbb2d846058b82915b36657f890450e800e 100644
(file)
--- a/
lunaix-os/includes/lunaix/sched.h
+++ b/
lunaix-os/includes/lunaix/sched.h
@@
-1,25
+1,40
@@
#ifndef __LUNAIX_SCHEDULER_H
#define __LUNAIX_SCHEDULER_H
#ifndef __LUNAIX_SCHEDULER_H
#define __LUNAIX_SCHEDULER_H
+#include <lunaix/compiler.h>
+#include <lunaix/process.h>
+
#define SCHED_TIME_SLICE 300
#define SCHED_TIME_SLICE 300
+#define MAX_THREAD_PP 1024
#define PROC_TABLE_SIZE 8192
#define PROC_TABLE_SIZE 8192
-#define MAX_PROCESS (PROC_TABLE_SIZE / sizeof(
uint
ptr_t))
+#define MAX_PROCESS (PROC_TABLE_SIZE / sizeof(ptr_t))
struct scheduler
{
struct scheduler
{
- struct proc_info** _procs;
+ struct proc_info** procs;
+ struct llist_header* threads;
+ struct llist_header* proc_list;
+ struct llist_header sleepers;
+
int procs_index;
int procs_index;
- unsigned int ptable_len;
+ int ptable_len;
+ int ttable_len;
};
void
sched_init();
};
void
sched_init();
-void
+void
noret
schedule();
void
schedule();
void
-sched_yieldk();
+sched_pass();
+
+void noret
+run(struct thread* thread);
+
+void
+cleanup_detached_threads();
#endif /* __LUNAIX_SCHEDULER_H */
#endif /* __LUNAIX_SCHEDULER_H */