aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/InterGrid
diff options
context:
space:
mode:
authorJohn Hurliman2009-10-22 12:33:23 -0700
committerJohn Hurliman2009-10-22 12:33:23 -0700
commitb2ed348aa2746fbf034b713d006e40366c479d5a (patch)
tree26c114e88f54e64e1fdf17dcc7de1e54165db2bc /OpenSim/Region/CoreModules/InterGrid
parentMerge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff)
downloadopensim-SC_OLD-b2ed348aa2746fbf034b713d006e40366c479d5a.zip
opensim-SC_OLD-b2ed348aa2746fbf034b713d006e40366c479d5a.tar.gz
opensim-SC_OLD-b2ed348aa2746fbf034b713d006e40366c479d5a.tar.bz2
opensim-SC_OLD-b2ed348aa2746fbf034b713d006e40366c479d5a.tar.xz
Implemented a Watchdog class. Do not manually create Thread objects anymore, use Watchdog.StartThread(). While your thread is running call Watchdog.UpdateThread(). When it is shutting down call Watchdog.RemoveThread(). Most of the threads in OpenSim have been updated
Diffstat (limited to 'OpenSim/Region/CoreModules/InterGrid')
-rw-r--r--OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs15
1 files changed, 10 insertions, 5 deletions
diff --git a/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs b/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs
index d636b1c..62500a2 100644
--- a/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs
+++ b/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs
@@ -1208,10 +1208,7 @@ namespace OpenSim.Region.CoreModules.InterGrid
1208 if (homeScene.TryGetAvatar(avatarId,out avatar)) 1208 if (homeScene.TryGetAvatar(avatarId,out avatar))
1209 { 1209 {
1210 KillAUser ku = new KillAUser(avatar,mod); 1210 KillAUser ku = new KillAUser(avatar,mod);
1211 Thread ta = new Thread(ku.ShutdownNoLogout); 1211 Watchdog.StartThread(ku.ShutdownNoLogout, "OGPShutdown", ThreadPriority.Normal, true);
1212 ta.IsBackground = true;
1213 ta.Name = "ShutdownThread";
1214 ta.Start();
1215 } 1212 }
1216 } 1213 }
1217 1214
@@ -1261,7 +1258,13 @@ namespace OpenSim.Region.CoreModules.InterGrid
1261 1258
1262 avToBeKilled.ControllingClient.SendLogoutPacketWhenClosing = false; 1259 avToBeKilled.ControllingClient.SendLogoutPacketWhenClosing = false;
1263 1260
1264 Thread.Sleep(30000); 1261 int sleepMS = 30000;
1262 while (sleepMS > 0)
1263 {
1264 Watchdog.UpdateThread();
1265 Thread.Sleep(1000);
1266 sleepMS -= 1000;
1267 }
1265 1268
1266 // test for child agent because they might have come back 1269 // test for child agent because they might have come back
1267 if (avToBeKilled.IsChildAgent) 1270 if (avToBeKilled.IsChildAgent)
@@ -1270,6 +1273,8 @@ namespace OpenSim.Region.CoreModules.InterGrid
1270 avToBeKilled.ControllingClient.Close(); 1273 avToBeKilled.ControllingClient.Close();
1271 } 1274 }
1272 } 1275 }
1276
1277 Watchdog.RemoveThread();
1273 } 1278 }
1274 1279
1275 } 1280 }