提交 de5ed123 创建 作者: Austin Clements's avatar Austin Clements

Use lock constructor in console

Mostly to make sure what I just did works.
上级 da450a4f
......@@ -25,9 +25,12 @@
static int panicked = 0;
static struct {
static struct cons {
struct spinlock lock;
int locking;
constexpr cons()
: lock("console", LOCKSTAT_CONSOLE), locking(0) { }
} cons;
static void
......@@ -358,7 +361,6 @@ console_stream uerr(false);
void
initconsole(void)
{
initlock(&cons.lock, "console", LOCKSTAT_CONSOLE);
cons.locking = 1;
devsw[MAJ_CONSOLE].write = consolewrite;
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论