diff options
Diffstat (limited to 'src/common/console.c')
-rw-r--r-- | src/common/console.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/common/console.c b/src/common/console.c index 4a12ba24b..f1b4523e2 100644 --- a/src/common/console.c +++ b/src/common/console.c @@ -57,6 +57,7 @@ struct console_interface console_s; struct console_interface *console; #ifdef CONSOLE_INPUT struct console_input_interface console_input_s; +struct spin_lock console_ptlock_s; struct { char queue[CONSOLE_PARSE_SIZE][MAX_CONSOLE_INPUT]; @@ -464,15 +465,15 @@ void *cThread_main(void *x) { console->input->parse(input); if( input[0] != '\0' ) {/* did we get something? */ - EnterSpinLock(&console->input->ptlock); + EnterSpinLock(console->input->ptlock); if( cinput.count == CONSOLE_PARSE_SIZE ) { - LeaveSpinLock(&console->input->ptlock); + LeaveSpinLock(console->input->ptlock); continue;/* drop */ } safestrncpy(cinput.queue[cinput.count++],input,MAX_CONSOLE_INPUT); - LeaveSpinLock(&console->input->ptlock); + LeaveSpinLock(console->input->ptlock); } } mutex->lock(console->input->ptmutex); @@ -484,12 +485,12 @@ void *cThread_main(void *x) { } int console_parse_timer(int tid, int64 tick, int id, intptr_t data) { int i; - EnterSpinLock(&console->input->ptlock); + EnterSpinLock(console->input->ptlock); for(i = 0; i < cinput.count; i++) { console->input->parse_sub(cinput.queue[i]); } cinput.count = 0; - LeaveSpinLock(&console->input->ptlock); + LeaveSpinLock(console->input->ptlock); mutex->cond_signal(console->input->ptcond); return 0; } @@ -510,7 +511,7 @@ void console_parse_init(void) { console->input->ptstate = 1; - InitializeSpinLock(&console->input->ptlock); + InitializeSpinLock(console->input->ptlock); console->input->ptmutex = mutex->create(); console->input->ptcond = mutex->cond_create(); @@ -563,6 +564,7 @@ void console_defaults(void) console->display_gplnotice = display_gplnotice; #ifdef CONSOLE_INPUT console->input = &console_input_s; + console->input->ptlock = &console_ptlock_s; console->input->parse_init = console_parse_init; console->input->parse_final = console_parse_final; console->input->parse_timer = console_parse_timer; |