From 5b203d7f824e49b0c417683fd5c4d5920e2eac4e Mon Sep 17 00:00:00 2001 From: iDunnoDev Date: Sat, 14 Jan 2023 00:40:23 +0000 Subject: [PATCH] Move the lock in the keyboard buffer Added comment to defs --- console.c | 3 ++- defs.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/console.c b/console.c index e6daad4..d560042 100644 --- a/console.c +++ b/console.c @@ -743,9 +743,10 @@ void consoleintr(int (*getc)(void)) int doconsolehome = 0; struct vconsole* inconsoleptr = getvalidprocessconsoleptr(); - struct kbdbuffer* consolekbdbuffer = ¤tconsole->keybuffer; acquire(&cons.lock); + struct kbdbuffer* consolekbdbuffer = ¤tconsole->keybuffer; + while ((c = getc()) >= 0) { switch (c) diff --git a/defs.h b/defs.h index d5d89d8..db91fa4 100644 --- a/defs.h +++ b/defs.h @@ -37,8 +37,9 @@ void clearscreen(int); struct vconsole* getbaseconsoleptr(void); // Function to provide cprintf functionality but saved into a char array void sprintf(char*, char*, ...); +// Function to set a consoles title void setconsoleproctitle(struct vconsole* consoleptr, char* newtitle); -//void drawtitle(); +// Function to get a consoles index int getconsoleindex(struct vconsole* consolein); // exec.c