Skip to content

Commit

Permalink
wierd
Browse files Browse the repository at this point in the history
  • Loading branch information
lxmonk committed May 11, 2012
1 parent c6b9ba6 commit 7d1eaf1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions uthread.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@ int uthread_create(void (*start_func)(), int priority){
ut_table.highest_p = priority;
ut_table.threads[ut_id]->priority = priority;
ut_table.threads[ut_id]->tid = ut_id;
DEBUG_PRINT("ut_id=%d, ut_table.threads[ut_id]->tid=%d",
ut_id, ut_table.threads[ut_id]->tid);
DEBUG_PRINT("ut_id=%d, ut_table.threads[ut_id]=%x",
ut_id, ut_table.threads[ut_id],
ut_table.threads[ut_id]->tid);
STORE_ESP(current_esp);
/* create the initial stack for the new thread */
LOAD_ESP(ut_table.threads[ut_id]->ss_sp);
Expand All @@ -83,11 +84,12 @@ int uthread_create(void (*start_func)(), int priority){

uthread_t* next_thread(int start) {
uthread_t *next;

DEBUG_PRINT("inside next", 900);
for (;;start = (start + 1) % MAX_UTHREADS) {
DEBUG_PRINT("start=%d", start);
next = ut_table.threads[start];
DEBUG_PRINT("next->tid=%d", next->tid);
DEBUG_PRINT("next=%x, next->tid=%d", next, next->tid);
if (next != 0) {
if (sched == ROUND_ROBIN ||
next->priority == ut_table.highest_p) {
Expand Down

0 comments on commit 7d1eaf1

Please sign in to comment.