From 9c6ef58cf0e017e9369afc1d9c9a468e3527725d Mon Sep 17 00:00:00 2001 From: pixel Date: Tue, 5 Aug 2008 11:33:13 +0000 Subject: Do not spawn a thread if not needed... --- src/lua-interface.cpp | 12 ++++++++---- 1 file 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); } -- cgit v1.2.3