Add snippet to fix thread-hangs-on-exit on server exit

Closes issue #842

--HG--
branch : trunk
This commit is contained in:
click
2010-04-19 18:15:41 +02:00
parent 450c6af43b
commit ed2e64af4c

View File

@@ -393,6 +393,15 @@ void CliRunnable::run()
{
fflush(stdout);
// Safe exit thread
#ifdef linux
while (!kb_hit_return() && !World::IsStopped())
// With this, we limit CLI to 10commands/second
usleep(100);
if (World::IsStopped())
break;
#endif
char *command_str ; // = fgets(commandbuf,sizeof(commandbuf),stdin);
#if PLATFORM == WINDOWS