mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 00:48:56 +01:00
Add snippet to fix thread-hangs-on-exit on server exit
Closes issue #842 --HG-- branch : trunk
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user