OSDN Git Service

Execute all commands on a separate thread
authorLatif Khalifa <latifer@streamgrid.net>
Sat, 12 Sep 2009 18:54:02 +0000 (18:54 +0000)
committerLatif Khalifa <latifer@streamgrid.net>
Sat, 12 Sep 2009 18:54:02 +0000 (18:54 +0000)
git-svn-id: https://radegast.googlecode.com/svn/trunk@227 f7a694da-4d33-11de-9ad6-1127a62b9fcd

Radegast/Core/Commands/CommandsManager.cs

index af5dae5..a8bc903 100644 (file)
@@ -172,7 +172,10 @@ namespace Radegast.Commands
                 {\r
                     if (manager.IsValidCommand(cmdline))\r
                     {\r
-                        manager.ExecuteCommand(WriteLine, cmdline);\r
+                        System.Threading.ThreadPool.QueueUserWorkItem((object state) =>\r
+                            {\r
+                                manager.ExecuteCommand(WriteLine, cmdline);\r
+                            });\r
                         return;\r
                     }\r
                 }\r
@@ -196,7 +199,10 @@ namespace Radegast.Commands
             {\r
                 try\r
                 {\r
-                    cmdimpl.Execute(cmd, parms, WriteLine);\r
+                    System.Threading.ThreadPool.QueueUserWorkItem((object state) =>\r
+                        {\r
+                            cmdimpl.Execute(cmd, parms, WriteLine);\r
+                        });\r
                 }\r
                 catch (Exception ex)\r
                 {\r