aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs')
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs43
1 files changed, 36 insertions, 7 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs
index 340d2e7..f0dccda 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs
@@ -65,6 +65,15 @@ namespace OpenSim.Region.ClientStack.Linden
65 65
66 // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 66 // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
67 67
68
69 /// <summary>
70 /// Control whether requests will be processed asynchronously.
71 /// </summary>
72 /// <remarks>
73 /// Defaults to true. Can currently not be changed once a region has been added to the module.
74 /// </remarks>
75 public bool ProcessQueuedRequestsAsync { get; private set; }
76
68 private Scene m_scene; 77 private Scene m_scene;
69 78
70 private IInventoryService m_InventoryService; 79 private IInventoryService m_InventoryService;
@@ -84,6 +93,13 @@ namespace OpenSim.Region.ClientStack.Linden
84 93
85 #region ISharedRegionModule Members 94 #region ISharedRegionModule Members
86 95
96 public WebFetchInvDescModule() : this(true) {}
97
98 public WebFetchInvDescModule(bool processQueuedResultsAsync)
99 {
100 ProcessQueuedRequestsAsync = processQueuedResultsAsync;
101 }
102
87 public void Initialise(IConfigSource source) 103 public void Initialise(IConfigSource source)
88 { 104 {
89 IConfig config = source.Configs["ClientStack.LindenCaps"]; 105 IConfig config = source.Configs["ClientStack.LindenCaps"];
@@ -114,8 +130,16 @@ namespace OpenSim.Region.ClientStack.Linden
114 130
115 m_scene.EventManager.OnRegisterCaps -= RegisterCaps; 131 m_scene.EventManager.OnRegisterCaps -= RegisterCaps;
116 132
117 foreach (Thread t in m_workerThreads) 133 if (ProcessQueuedRequestsAsync)
118 Watchdog.AbortThread(t.ManagedThreadId); 134 {
135 if (m_workerThreads != null)
136 {
137 foreach (Thread t in m_workerThreads)
138 Watchdog.AbortThread(t.ManagedThreadId);
139
140 m_workerThreads = null;
141 }
142 }
119 143
120 m_scene = null; 144 m_scene = null;
121 } 145 }
@@ -133,7 +157,7 @@ namespace OpenSim.Region.ClientStack.Linden
133 157
134 m_scene.EventManager.OnRegisterCaps += RegisterCaps; 158 m_scene.EventManager.OnRegisterCaps += RegisterCaps;
135 159
136 if (m_workerThreads == null) 160 if (ProcessQueuedRequestsAsync && m_workerThreads == null)
137 { 161 {
138 m_workerThreads = new Thread[2]; 162 m_workerThreads = new Thread[2];
139 163
@@ -358,11 +382,16 @@ namespace OpenSim.Region.ClientStack.Linden
358 { 382 {
359 Watchdog.UpdateThread(); 383 Watchdog.UpdateThread();
360 384
361 aPollRequest poolreq = m_queue.Dequeue(); 385 WaitProcessQueuedInventoryRequest();
362
363 if (poolreq != null && poolreq.thepoll != null)
364 poolreq.thepoll.Process(poolreq);
365 } 386 }
366 } 387 }
388
389 public void WaitProcessQueuedInventoryRequest()
390 {
391 aPollRequest poolreq = m_queue.Dequeue();
392
393 if (poolreq != null && poolreq.thepoll != null)
394 poolreq.thepoll.Process(poolreq);
395 }
367 } 396 }
368} 397}