Add IScriptInstance.EventsQueued to match EventsProcessed instead of asking callers to lock and directly inspect the EventQueue

0.7.5-pf-bulletsim
Justin Clark-Casey (justincc) 2012-12-05 23:33:48 +00:00
parent 652f4bcb42
commit 5ba99cbf55
3 changed files with 15 additions and 4 deletions

View File

@ -114,6 +114,11 @@ namespace OpenSim.Region.ScriptEngine.Interfaces
UUID AssetID { get; }
Queue EventQueue { get; }
/// <summary>
/// Number of events queued for processing.
/// </summary>
long EventsQueued { get; }
/// <summary>
/// Number of events processed by this script instance.
/// </summary>

View File

@ -173,6 +173,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
public Queue EventQueue { get; private set; }
public long EventsQueued
{
get
{
lock (EventQueue)
return EventQueue.Count;
}
}
public long EventsProcessed { get; private set; }
public int StartParam { get; set; }

View File

@ -526,10 +526,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
sb.AppendFormat("Script name : {0}\n", instance.ScriptName);
sb.AppendFormat("Status : {0}\n", status);
lock (eq)
sb.AppendFormat("Queued events : {0}\n", eq.Count);
sb.AppendFormat("Queued events : {0}\n", instance.EventsQueued);
sb.AppendFormat("Processed events : {0}\n", instance.EventsProcessed);
sb.AppendFormat("Item UUID : {0}\n", instance.ItemID);
sb.AppendFormat("Containing part name: {0}\n", instance.PrimName);