Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复由于textui加锁,更改了preempt_count导致“进程长时间连续输出字符”的情况下,进程调度器不运行的问题。 #203

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions kernel/src/libs/libUI/textui.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,15 +213,15 @@ int textui_putchar_window(struct textui_window_t *window, uint16_t character, ui
return 0;

// uint64_t rflags = 0; // 加锁后rflags存储到这里
spin_lock(&window->lock);
spin_lock_no_preempt(&window->lock);
c_uart_send(COM1, character);
if (unlikely(character == '\n'))
{
// 换行时还需要输出\r
c_uart_send(COM1, '\r');
__textui_new_line(window, window->vline_operating);
// spin_unlock_irqrestore(&window->lock, rflags);
spin_unlock(&window->lock);
spin_unlock_no_preempt(&window->lock);
return 0;
}
else if (character == '\t') // 输出制表符
Expand Down Expand Up @@ -275,7 +275,7 @@ int textui_putchar_window(struct textui_window_t *window, uint16_t character, ui
}

// spin_unlock_irqrestore(&window->lock, rflags);
spin_unlock(&window->lock);
spin_unlock_no_preempt(&window->lock);
return 0;
}

Expand Down