diff options
author | pixel <pixel> | 2008-08-05 11:33:13 +0000 |
---|---|---|
committer | pixel <pixel> | 2008-08-05 11:33:13 +0000 |
commit | 9c6ef58cf0e017e9369afc1d9c9a468e3527725d (patch) | |
tree | cf957ce3dc3622673c310fe610d4eb6d0591250f | |
parent | 91521058f068ba8be4e3812f026d4d72e8f2d8e8 (diff) |
Do not spawn a thread if not needed...
-rw-r--r-- | src/lua-interface.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/lua-interface.cpp b/src/lua-interface.cpp index d216878..f296351 100644 --- a/src/lua-interface.cpp +++ b/src/lua-interface.cpp @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id: lua-interface.cpp,v 1.7 2008-08-04 15:36:33 pixel Exp $ */ +/* $Id: lua-interface.cpp,v 1.8 2008-08-05 11:33:13 pixel Exp $ */ #define WIP @@ -814,8 +814,12 @@ virtual int startup() throw (GeneralException) { } if (interactive) { - pthread_create(&interactive_thread, NULL, interactive_prompt, L->thread(true)); - L->pop(); + if (server) { + pthread_create(&interactive_thread, NULL, interactive_prompt, L->thread(true)); + L->pop(); + } else { + interactive_prompt(L); + } } if (server) { @@ -828,7 +832,7 @@ virtual int startup() throw (GeneralException) { StartTaskLoop(0); } - if (interactive) { + if (interactive && server) { pthread_join(interactive_thread, NULL); } |