[lib][console] move the state of the console into an object
This will allow in the future multiple instances of it to be active at at a time. Place the current console in a new TLS slot per thread so threads created as a side effect of console commands can properly run commands.
This commit is contained in:
@@ -48,6 +48,9 @@ typedef int (*thread_start_routine)(void *arg);
|
||||
|
||||
/* thread local storage */
|
||||
enum thread_tls_list {
|
||||
#ifdef WITH_LIB_CONSOLE
|
||||
TLS_ENTRY_CONSOLE, // current console
|
||||
#endif
|
||||
#ifdef WITH_LIB_UTHREAD
|
||||
TLS_ENTRY_UTHREAD,
|
||||
#endif
|
||||
|
||||
@@ -202,7 +202,7 @@ thread_t *thread_create_etc(thread_t *t, const char *name, thread_start_routine
|
||||
/* save whether or not we need to free the thread struct and/or stack */
|
||||
t->flags = flags;
|
||||
|
||||
/* inheirit thread local storage from the parent */
|
||||
/* inherit thread local storage from the parent */
|
||||
thread_t *current_thread = get_current_thread();
|
||||
int i;
|
||||
for (i=0; i < MAX_TLS_ENTRY; i++)
|
||||
|
||||
Reference in New Issue
Block a user