Showing the changes to src/host/chuck_main.cpp (1 of 2 files). Show all
Unified · Split
| @@ -42,6 +42,7 @@ · 41 unmodified lines | |||
| 42 | // function prototypes | 42 | // function prototypes |
| 43 | //----------------------------------------------------------------------------- | 43 | //----------------------------------------------------------------------------- |
| 44 | t_CKBOOL init_shell( Chuck_Shell * shell, Chuck_Shell_UI * ui, Chuck_VM * vm ); | 44 | t_CKBOOL init_shell( Chuck_Shell * shell, Chuck_Shell_UI * ui, Chuck_VM * vm ); |
| 45 | void * shell_cb( void * p ); | ||
| 45 | bool go( int argc, const char ** argv ); | 46 | bool go( int argc, const char ** argv ); |
| 46 | void global_cleanup(); | 47 | void global_cleanup(); |
| 47 | void all_stop(); | 48 | void all_stop(); |
| @@ -340,6 +341,38 @@ t_CKBOOL init_shell( Chuck_Shell * shell, Chuck_Shell_UI * ui, Chuck_VM * vm ) · 292 unmodified lines | |||
| 340 | 341 | ||
| 341 | 342 | ||
| 342 | 343 | ||
| 344 | //----------------------------------------------------------------------------- | ||
| 345 | // name: shell_cb | ||
| 346 | // desc: thread routine | ||
| 347 | //----------------------------------------------------------------------------- | ||
| 348 | void * shell_cb( void * p ) | ||
| 349 | { | ||
| 350 | Chuck_Shell * shell; | ||
| 351 | // log | ||
| 352 | EM_log( CK_LOG_INFO, "starting thread routine for shell..." ); | ||
| 353 | |||
| 354 | // assuming this is absolutely necessary, an assert may be better | ||
| 355 | assert( p != NULL ); | ||
| 356 | |||
| 357 | shell = ( Chuck_Shell * ) p; | ||
| 358 | |||
| 359 | //atexit( wait_for_shell ); | ||
| 360 | |||
| 361 | // run the shell | ||
| 362 | shell->run(); | ||
| 363 | |||
| 364 | // delete and set to NULL | ||
| 365 | SAFE_DELETE( g_shell ); | ||
| 366 | // perhaps let shell destructor clean up mode and ui? | ||
| 367 | |||
| 368 | EM_log( CK_LOG_INFO, "exiting thread routine for shell..." ); | ||
| 369 | |||
| 370 | return NULL; | ||
| 371 | } | ||
| 372 | |||
| 373 | |||
| 374 | |||
| 375 | |||
| 343 | //----------------------------------------------------------------------------- | 376 | //----------------------------------------------------------------------------- |
| 344 | // name: go() | 377 | // name: go() |
| 345 | // desc: parse args, init stuff, run! | 378 | // desc: parse args, init stuff, run! |