diff options
author | Justin Clark-Casey (justincc) | 2014-11-21 01:08:58 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2014-11-25 23:23:11 +0000 |
commit | 28d1dbfee4256a97744ed1cebe21971adf5fdaef (patch) | |
tree | c7268d275db86f783e35a9e77415760bd9142561 /OpenSim/Region/Framework/Scenes/ScenePresence.cs | |
parent | Add [BulletSim] option AvatarToAvatarCollisionsByDefault to control whether a... (diff) | |
download | opensim-SC-28d1dbfee4256a97744ed1cebe21971adf5fdaef.zip opensim-SC-28d1dbfee4256a97744ed1cebe21971adf5fdaef.tar.gz opensim-SC-28d1dbfee4256a97744ed1cebe21971adf5fdaef.tar.bz2 opensim-SC-28d1dbfee4256a97744ed1cebe21971adf5fdaef.tar.xz |
Move conditionals which control whether a task is placed in the JobEngine inside Watchdog.RunJob() (renamed from RunWhenPossible) and generalize them.
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 68 |
1 files changed, 25 insertions, 43 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 1d234e2..757ec43 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -1228,15 +1228,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
1228 | // viewers without (e.g. v1 viewers) will not, so we still need to make this call. | 1228 | // viewers without (e.g. v1 viewers) will not, so we still need to make this call. |
1229 | if (Scene.AttachmentsModule != null) | 1229 | if (Scene.AttachmentsModule != null) |
1230 | { | 1230 | { |
1231 | if (Watchdog.JobEngine.IsRunning) | 1231 | Watchdog.RunJob( |
1232 | Watchdog.RunWhenPossible( | 1232 | "RezAttachments", |
1233 | "RezAttachments", | 1233 | o => Scene.AttachmentsModule.RezAttachments(this), |
1234 | o => Scene.AttachmentsModule.RezAttachments(this), | 1234 | string.Format("Rez attachments for {0} in {1}", Name, Scene.Name), |
1235 | string.Format("Rez attachments for {0} in {1}", Name, Scene.Name), | 1235 | null); |
1236 | null); | ||
1237 | else | ||
1238 | Util.FireAndForget( | ||
1239 | o => Scene.AttachmentsModule.RezAttachments(this), null, "ScenePresence.RezAttachmentsOnLogin"); | ||
1240 | } | 1236 | } |
1241 | } | 1237 | } |
1242 | else | 1238 | else |
@@ -1258,18 +1254,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
1258 | 1254 | ||
1259 | if (attachments.Count > 0) | 1255 | if (attachments.Count > 0) |
1260 | { | 1256 | { |
1261 | if (Watchdog.JobEngine.IsRunning) | 1257 | Watchdog.RunJob( |
1262 | { | 1258 | "StartAttachmentScripts", |
1263 | Watchdog.RunWhenPossible( | 1259 | o => RestartAttachmentScripts(attachments), |
1264 | "StartAttachmentScripts", | 1260 | string.Format("Start attachment scripts for {0} in {1}", Name, Scene.Name), |
1265 | o => RestartAttachmentScripts(attachments), | 1261 | null, |
1266 | string.Format("Start attachment scripts for {0} in {1}", Name, Scene.Name), | 1262 | true); |
1267 | null); | ||
1268 | } | ||
1269 | else | ||
1270 | { | ||
1271 | RestartAttachmentScripts(attachments); | ||
1272 | } | ||
1273 | } | 1263 | } |
1274 | } | 1264 | } |
1275 | 1265 | ||
@@ -1825,18 +1815,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
1825 | // XXX: If we force an update after activity has completed, then multiple attachments do appear correctly on a destination region | 1815 | // XXX: If we force an update after activity has completed, then multiple attachments do appear correctly on a destination region |
1826 | // If we do it a little bit earlier (e.g. when converting the child to a root agent) then this does not work. | 1816 | // If we do it a little bit earlier (e.g. when converting the child to a root agent) then this does not work. |
1827 | // This may be due to viewer code or it may be something we're not doing properly simulator side. | 1817 | // This may be due to viewer code or it may be something we're not doing properly simulator side. |
1828 | if (Watchdog.JobEngine.IsRunning) | 1818 | Watchdog.RunJob( |
1829 | { | 1819 | "ScheduleAttachmentsForFullUpdate", |
1830 | Watchdog.RunWhenPossible( | 1820 | o => ScheduleAttachmentsForFullUpdate(), |
1831 | "ScheduleAttachmentsForFullUpdate", | 1821 | string.Format("Schedule attachments for full update for {0} in {1}", Name, Scene.Name), |
1832 | o => ScheduleAttachmentsForFullUpdate(), | 1822 | null, |
1833 | string.Format("Schedule attachments for full update for {0} in {1}", Name, Scene.Name), | 1823 | true); |
1834 | null); | ||
1835 | } | ||
1836 | else | ||
1837 | { | ||
1838 | ScheduleAttachmentsForFullUpdate(); | ||
1839 | } | ||
1840 | 1824 | ||
1841 | // m_log.DebugFormat( | 1825 | // m_log.DebugFormat( |
1842 | // "[SCENE PRESENCE]: Completing movement of {0} into region {1} took {2}ms", | 1826 | // "[SCENE PRESENCE]: Completing movement of {0} into region {1} took {2}ms", |
@@ -3391,7 +3375,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3391 | SentInitialDataToClient = true; | 3375 | SentInitialDataToClient = true; |
3392 | 3376 | ||
3393 | // Send all scene object to the new client | 3377 | // Send all scene object to the new client |
3394 | Watchdog.RunWhenPossible("SendInitialDataToClient", delegate | 3378 | Watchdog.RunJob("SendInitialDataToClient", delegate |
3395 | { | 3379 | { |
3396 | // m_log.DebugFormat( | 3380 | // m_log.DebugFormat( |
3397 | // "[SCENE PRESENCE]: Sending initial data to {0} agent {1} in {2}, tp flags {3}", | 3381 | // "[SCENE PRESENCE]: Sending initial data to {0} agent {1} in {2}, tp flags {3}", |
@@ -3409,7 +3393,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3409 | if (e != null && e is SceneObjectGroup) | 3393 | if (e != null && e is SceneObjectGroup) |
3410 | ((SceneObjectGroup)e).SendFullUpdateToClient(ControllingClient); | 3394 | ((SceneObjectGroup)e).SendFullUpdateToClient(ControllingClient); |
3411 | } | 3395 | } |
3412 | }, string.Format("SendInitialDataToClient ({0} in {1})", Name, Scene.Name), null); | 3396 | }, string.Format("SendInitialDataToClient ({0} in {1})", Name, Scene.Name),null, false, true); |
3413 | } | 3397 | } |
3414 | 3398 | ||
3415 | /// <summary> | 3399 | /// <summary> |
@@ -4073,14 +4057,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
4073 | // We don't need to worry about a race condition as the job to later start the scripts is also | 4057 | // We don't need to worry about a race condition as the job to later start the scripts is also |
4074 | // JobEngine scheduled and so will always occur after this task. | 4058 | // JobEngine scheduled and so will always occur after this task. |
4075 | // XXX: This will not be true if JobEngine ever gets more than one thread. | 4059 | // XXX: This will not be true if JobEngine ever gets more than one thread. |
4076 | if (Watchdog.JobEngine.IsRunning) | 4060 | Watchdog.RunJob( |
4077 | Watchdog.RunWhenPossible( | 4061 | "CopyAttachments", |
4078 | "CopyAttachments", | 4062 | o => Scene.AttachmentsModule.CopyAttachments(cAgent, this), |
4079 | o => Scene.AttachmentsModule.CopyAttachments(cAgent, this), | 4063 | string.Format("Copy attachments for {0} entering {1}", Name, Scene.Name), |
4080 | string.Format("Copy attachments for {0} entering {1}", Name, Scene.Name), | 4064 | null, |
4081 | null); | 4065 | true); |
4082 | else | ||
4083 | Scene.AttachmentsModule.CopyAttachments(cAgent, this); | ||
4084 | } | 4066 | } |
4085 | 4067 | ||
4086 | // This must occur after attachments are copied or scheduled to be copied, as it releases the CompleteMovement() calling thread | 4068 | // This must occur after attachments are copied or scheduled to be copied, as it releases the CompleteMovement() calling thread |