History

moved g_shell out of chuck_shell.cpp

Ge Wang committed 9 years ago

Commit 4ff85261 parent e1c0b212 files · +241 −37Browse files

Showing the changes to src/host/chuck_main.cpp (1 of 2 files). Show all

Unified · Split

src/host/chuck_main.cpp+33−0
@@ -42,6 +42,7 @@ · 41 unmodified lines
4242 // function prototypes
4343 //-----------------------------------------------------------------------------
4444 t_CKBOOL init_shell( Chuck_Shell * shell, Chuck_Shell_UI * ui, Chuck_VM * vm );
45+void * shell_cb( void * p );
4546 bool go( int argc, const char ** argv );
4647 void global_cleanup();
4748 void all_stop();
@@ -340,6 +341,38 @@ t_CKBOOL init_shell( Chuck_Shell * shell, Chuck_Shell_UI * ui, Chuck_VM * vm ) · 292 unmodified lines
340341
341342
342343
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+
343376 //-----------------------------------------------------------------------------
344377 // name: go()
345378 // desc: parse args, init stuff, run!

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t