diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index e0009bb705..e6d6cbf743 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -646,11 +646,12 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
}
else
{
- if (remoteClient == null || so.OwnerID != remoteClient.AgentId)
+ if (remoteClient == null || so.RootPart.OwnerID != remoteClient.AgentId)
{
// Taking copy of another person's item. Take to
// Objects folder.
folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.Object);
+ so.FromFolderID = UUID.Zero;
}
else
{
@@ -666,10 +667,16 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
//
if (action == DeRezAction.Take || action == DeRezAction.TakeCopy)
{
- if (so.FromFolderID != UUID.Zero && userID == remoteClient.AgentId)
+ if (so.FromFolderID != UUID.Zero && so.RootPart.OwnerID == remoteClient.AgentId)
{
InventoryFolderBase f = new InventoryFolderBase(so.FromFolderID, userID);
folder = m_Scene.InventoryService.GetFolder(f);
+
+ if(folder.Type == 14 || folder.Type == 16)
+ {
+ // folder.Type = 6;
+ folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.Object);
+ }
}
}
diff --git a/ThirdParty/SmartThreadPool/CallerThreadContext.cs b/ThirdParty/SmartThreadPool/CallerThreadContext.cs
index 2177241a02..e63add594e 100644
--- a/ThirdParty/SmartThreadPool/CallerThreadContext.cs
+++ b/ThirdParty/SmartThreadPool/CallerThreadContext.cs
@@ -1,138 +1,138 @@
-
-#if !(_WINDOWS_CE) && !(_SILVERLIGHT) && !(WINDOWS_PHONE)
-
-using System;
-using System.Diagnostics;
-using System.Threading;
-using System.Reflection;
-using System.Web;
-using System.Runtime.Remoting.Messaging;
-
-
-namespace Amib.Threading.Internal
-{
-#region CallerThreadContext class
-
- ///
- /// This class stores the caller call context in order to restore
- /// it when the work item is executed in the thread pool environment.
- ///
- internal class CallerThreadContext
- {
-#region Prepare reflection information
-
- // Cached type information.
- private static readonly MethodInfo getLogicalCallContextMethodInfo =
- typeof(Thread).GetMethod("GetLogicalCallContext", BindingFlags.Instance | BindingFlags.NonPublic);
-
- private static readonly MethodInfo setLogicalCallContextMethodInfo =
- typeof(Thread).GetMethod("SetLogicalCallContext", BindingFlags.Instance | BindingFlags.NonPublic);
-
- private static string HttpContextSlotName = GetHttpContextSlotName();
-
- private static string GetHttpContextSlotName()
- {
- FieldInfo fi = typeof(HttpContext).GetField("CallContextSlotName", BindingFlags.Static | BindingFlags.NonPublic);
-
- if (fi != null)
- {
- return (string) fi.GetValue(null);
- }
-
- return "HttpContext";
- }
-
- #endregion
-
-#region Private fields
-
- private HttpContext _httpContext;
- private LogicalCallContext _callContext;
-
- #endregion
-
- ///
- /// Constructor
- ///
- private CallerThreadContext()
- {
- }
-
- public bool CapturedCallContext
- {
- get
- {
- return (null != _callContext);
- }
- }
-
- public bool CapturedHttpContext
- {
- get
- {
- return (null != _httpContext);
- }
- }
-
- ///
- /// Captures the current thread context
- ///
- ///
- public static CallerThreadContext Capture(
- bool captureCallContext,
- bool captureHttpContext)
- {
- Debug.Assert(captureCallContext || captureHttpContext);
-
- CallerThreadContext callerThreadContext = new CallerThreadContext();
-
- // TODO: In NET 2.0, redo using the new feature of ExecutionContext class - Capture()
- // Capture Call Context
- if(captureCallContext && (getLogicalCallContextMethodInfo != null))
- {
- callerThreadContext._callContext = (LogicalCallContext)getLogicalCallContextMethodInfo.Invoke(Thread.CurrentThread, null);
- if (callerThreadContext._callContext != null)
- {
- callerThreadContext._callContext = (LogicalCallContext)callerThreadContext._callContext.Clone();
- }
- }
-
- // Capture httpContext
- if (captureHttpContext && (null != HttpContext.Current))
- {
- callerThreadContext._httpContext = HttpContext.Current;
- }
-
- return callerThreadContext;
- }
-
- ///
- /// Applies the thread context stored earlier
- ///
- ///
- public static void Apply(CallerThreadContext callerThreadContext)
- {
- if (null == callerThreadContext)
- {
- throw new ArgumentNullException("callerThreadContext");
- }
-
- // Todo: In NET 2.0, redo using the new feature of ExecutionContext class - Run()
- // Restore call context
- if ((callerThreadContext._callContext != null) && (setLogicalCallContextMethodInfo != null))
- {
- setLogicalCallContextMethodInfo.Invoke(Thread.CurrentThread, new object[] { callerThreadContext._callContext });
- }
-
- // Restore HttpContext
- if (callerThreadContext._httpContext != null)
- {
- HttpContext.Current = callerThreadContext._httpContext;
- //CallContext.SetData(HttpContextSlotName, callerThreadContext._httpContext);
- }
- }
- }
-
- #endregion
-}
-#endif
+
+#if !(_WINDOWS_CE) && !(_SILVERLIGHT) && !(WINDOWS_PHONE)
+
+using System;
+using System.Diagnostics;
+using System.Threading;
+using System.Reflection;
+using System.Web;
+using System.Runtime.Remoting.Messaging;
+
+
+namespace Amib.Threading.Internal
+{
+#region CallerThreadContext class
+
+ ///
+ /// This class stores the caller call context in order to restore
+ /// it when the work item is executed in the thread pool environment.
+ ///
+ internal class CallerThreadContext
+ {
+#region Prepare reflection information
+
+ // Cached type information.
+ private static readonly MethodInfo getLogicalCallContextMethodInfo =
+ typeof(Thread).GetMethod("GetLogicalCallContext", BindingFlags.Instance | BindingFlags.NonPublic);
+
+ private static readonly MethodInfo setLogicalCallContextMethodInfo =
+ typeof(Thread).GetMethod("SetLogicalCallContext", BindingFlags.Instance | BindingFlags.NonPublic);
+
+ private static string HttpContextSlotName = GetHttpContextSlotName();
+
+ private static string GetHttpContextSlotName()
+ {
+ FieldInfo fi = typeof(HttpContext).GetField("CallContextSlotName", BindingFlags.Static | BindingFlags.NonPublic);
+
+ if (fi != null)
+ {
+ return (string) fi.GetValue(null);
+ }
+
+ return "HttpContext";
+ }
+
+ #endregion
+
+#region Private fields
+
+ private HttpContext _httpContext;
+ private LogicalCallContext _callContext;
+
+ #endregion
+
+ ///
+ /// Constructor
+ ///
+ private CallerThreadContext()
+ {
+ }
+
+ public bool CapturedCallContext
+ {
+ get
+ {
+ return (null != _callContext);
+ }
+ }
+
+ public bool CapturedHttpContext
+ {
+ get
+ {
+ return (null != _httpContext);
+ }
+ }
+
+ ///
+ /// Captures the current thread context
+ ///
+ ///
+ public static CallerThreadContext Capture(
+ bool captureCallContext,
+ bool captureHttpContext)
+ {
+ Debug.Assert(captureCallContext || captureHttpContext);
+
+ CallerThreadContext callerThreadContext = new CallerThreadContext();
+
+ // TODO: In NET 2.0, redo using the new feature of ExecutionContext class - Capture()
+ // Capture Call Context
+ if(captureCallContext && (getLogicalCallContextMethodInfo != null))
+ {
+ callerThreadContext._callContext = (LogicalCallContext)getLogicalCallContextMethodInfo.Invoke(Thread.CurrentThread, null);
+ if (callerThreadContext._callContext != null)
+ {
+ callerThreadContext._callContext = (LogicalCallContext)callerThreadContext._callContext.Clone();
+ }
+ }
+
+ // Capture httpContext
+ if (captureHttpContext && (null != HttpContext.Current))
+ {
+ callerThreadContext._httpContext = HttpContext.Current;
+ }
+
+ return callerThreadContext;
+ }
+
+ ///
+ /// Applies the thread context stored earlier
+ ///
+ ///
+ public static void Apply(CallerThreadContext callerThreadContext)
+ {
+ if (null == callerThreadContext)
+ {
+ throw new ArgumentNullException("callerThreadContext");
+ }
+
+ // Todo: In NET 2.0, redo using the new feature of ExecutionContext class - Run()
+ // Restore call context
+ if ((callerThreadContext._callContext != null) && (setLogicalCallContextMethodInfo != null))
+ {
+ setLogicalCallContextMethodInfo.Invoke(Thread.CurrentThread, new object[] { callerThreadContext._callContext });
+ }
+
+ // Restore HttpContext
+ if (callerThreadContext._httpContext != null)
+ {
+ HttpContext.Current = callerThreadContext._httpContext;
+ //CallContext.SetData(HttpContextSlotName, callerThreadContext._httpContext);
+ }
+ }
+ }
+
+ #endregion
+}
+#endif
diff --git a/ThirdParty/SmartThreadPool/CanceledWorkItemsGroup.cs b/ThirdParty/SmartThreadPool/CanceledWorkItemsGroup.cs
index 4a2a3e7bc3..5752957878 100644
--- a/ThirdParty/SmartThreadPool/CanceledWorkItemsGroup.cs
+++ b/ThirdParty/SmartThreadPool/CanceledWorkItemsGroup.cs
@@ -1,14 +1,14 @@
-namespace Amib.Threading.Internal
-{
- internal class CanceledWorkItemsGroup
- {
- public readonly static CanceledWorkItemsGroup NotCanceledWorkItemsGroup = new CanceledWorkItemsGroup();
-
- public CanceledWorkItemsGroup()
- {
- IsCanceled = false;
- }
-
- public bool IsCanceled { get; set; }
- }
+namespace Amib.Threading.Internal
+{
+ internal class CanceledWorkItemsGroup
+ {
+ public readonly static CanceledWorkItemsGroup NotCanceledWorkItemsGroup = new CanceledWorkItemsGroup();
+
+ public CanceledWorkItemsGroup()
+ {
+ IsCanceled = false;
+ }
+
+ public bool IsCanceled { get; set; }
+ }
}
\ No newline at end of file
diff --git a/ThirdParty/SmartThreadPool/EventWaitHandle.cs b/ThirdParty/SmartThreadPool/EventWaitHandle.cs
index 70a1a29b93..25be07a530 100644
--- a/ThirdParty/SmartThreadPool/EventWaitHandle.cs
+++ b/ThirdParty/SmartThreadPool/EventWaitHandle.cs
@@ -1,104 +1,104 @@
-#if (_WINDOWS_CE)
-
-using System;
-using System.Runtime.InteropServices;
-using System.Threading;
-
-namespace Amib.Threading.Internal
-{
- ///
- /// EventWaitHandle class
- /// In WindowsCE this class doesn't exist and I needed the WaitAll and WaitAny implementation.
- /// So I wrote this class to implement these two methods with some of their overloads.
- /// It uses the WaitForMultipleObjects API to do the WaitAll and WaitAny.
- /// Note that this class doesn't even inherit from WaitHandle!
- ///
- public class STPEventWaitHandle
- {
- #region Public Constants
-
- public const int WaitTimeout = Timeout.Infinite;
-
- #endregion
-
- #region Private External Constants
-
- private const Int32 WAIT_FAILED = -1;
- private const Int32 WAIT_TIMEOUT = 0x102;
- private const UInt32 INFINITE = 0xFFFFFFFF;
-
- #endregion
-
- #region WaitAll and WaitAny
-
- internal static bool WaitOne(WaitHandle waitHandle, int millisecondsTimeout, bool exitContext)
- {
- return waitHandle.WaitOne(millisecondsTimeout, exitContext);
- }
-
- private static IntPtr[] PrepareNativeHandles(WaitHandle[] waitHandles)
- {
- IntPtr[] nativeHandles = new IntPtr[waitHandles.Length];
- for (int i = 0; i < waitHandles.Length; i++)
- {
- nativeHandles[i] = waitHandles[i].Handle;
- }
- return nativeHandles;
- }
-
- public static bool WaitAll(WaitHandle[] waitHandles, int millisecondsTimeout, bool exitContext)
- {
- uint timeout = millisecondsTimeout < 0 ? INFINITE : (uint)millisecondsTimeout;
-
- IntPtr[] nativeHandles = PrepareNativeHandles(waitHandles);
-
- int result = WaitForMultipleObjects((uint)waitHandles.Length, nativeHandles, true, timeout);
-
- if (result == WAIT_TIMEOUT || result == WAIT_FAILED)
- {
- return false;
- }
-
- return true;
- }
-
-
- public static int WaitAny(WaitHandle[] waitHandles, int millisecondsTimeout, bool exitContext)
- {
- uint timeout = millisecondsTimeout < 0 ? INFINITE : (uint)millisecondsTimeout;
-
- IntPtr[] nativeHandles = PrepareNativeHandles(waitHandles);
-
- int result = WaitForMultipleObjects((uint)waitHandles.Length, nativeHandles, false, timeout);
-
- if (result >= 0 && result < waitHandles.Length)
- {
- return result;
- }
-
- return -1;
- }
-
- public static int WaitAny(WaitHandle[] waitHandles)
- {
- return WaitAny(waitHandles, Timeout.Infinite, false);
- }
-
- public static int WaitAny(WaitHandle[] waitHandles, TimeSpan timeout, bool exitContext)
- {
- int millisecondsTimeout = (int)timeout.TotalMilliseconds;
-
- return WaitAny(waitHandles, millisecondsTimeout, false);
- }
-
- #endregion
-
- #region External methods
-
- [DllImport("coredll.dll", SetLastError = true)]
- public static extern int WaitForMultipleObjects(uint nCount, IntPtr[] lpHandles, bool fWaitAll, uint dwMilliseconds);
-
- #endregion
- }
-}
+#if (_WINDOWS_CE)
+
+using System;
+using System.Runtime.InteropServices;
+using System.Threading;
+
+namespace Amib.Threading.Internal
+{
+ ///
+ /// EventWaitHandle class
+ /// In WindowsCE this class doesn't exist and I needed the WaitAll and WaitAny implementation.
+ /// So I wrote this class to implement these two methods with some of their overloads.
+ /// It uses the WaitForMultipleObjects API to do the WaitAll and WaitAny.
+ /// Note that this class doesn't even inherit from WaitHandle!
+ ///
+ public class STPEventWaitHandle
+ {
+ #region Public Constants
+
+ public const int WaitTimeout = Timeout.Infinite;
+
+ #endregion
+
+ #region Private External Constants
+
+ private const Int32 WAIT_FAILED = -1;
+ private const Int32 WAIT_TIMEOUT = 0x102;
+ private const UInt32 INFINITE = 0xFFFFFFFF;
+
+ #endregion
+
+ #region WaitAll and WaitAny
+
+ internal static bool WaitOne(WaitHandle waitHandle, int millisecondsTimeout, bool exitContext)
+ {
+ return waitHandle.WaitOne(millisecondsTimeout, exitContext);
+ }
+
+ private static IntPtr[] PrepareNativeHandles(WaitHandle[] waitHandles)
+ {
+ IntPtr[] nativeHandles = new IntPtr[waitHandles.Length];
+ for (int i = 0; i < waitHandles.Length; i++)
+ {
+ nativeHandles[i] = waitHandles[i].Handle;
+ }
+ return nativeHandles;
+ }
+
+ public static bool WaitAll(WaitHandle[] waitHandles, int millisecondsTimeout, bool exitContext)
+ {
+ uint timeout = millisecondsTimeout < 0 ? INFINITE : (uint)millisecondsTimeout;
+
+ IntPtr[] nativeHandles = PrepareNativeHandles(waitHandles);
+
+ int result = WaitForMultipleObjects((uint)waitHandles.Length, nativeHandles, true, timeout);
+
+ if (result == WAIT_TIMEOUT || result == WAIT_FAILED)
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+
+ public static int WaitAny(WaitHandle[] waitHandles, int millisecondsTimeout, bool exitContext)
+ {
+ uint timeout = millisecondsTimeout < 0 ? INFINITE : (uint)millisecondsTimeout;
+
+ IntPtr[] nativeHandles = PrepareNativeHandles(waitHandles);
+
+ int result = WaitForMultipleObjects((uint)waitHandles.Length, nativeHandles, false, timeout);
+
+ if (result >= 0 && result < waitHandles.Length)
+ {
+ return result;
+ }
+
+ return -1;
+ }
+
+ public static int WaitAny(WaitHandle[] waitHandles)
+ {
+ return WaitAny(waitHandles, Timeout.Infinite, false);
+ }
+
+ public static int WaitAny(WaitHandle[] waitHandles, TimeSpan timeout, bool exitContext)
+ {
+ int millisecondsTimeout = (int)timeout.TotalMilliseconds;
+
+ return WaitAny(waitHandles, millisecondsTimeout, false);
+ }
+
+ #endregion
+
+ #region External methods
+
+ [DllImport("coredll.dll", SetLastError = true)]
+ public static extern int WaitForMultipleObjects(uint nCount, IntPtr[] lpHandles, bool fWaitAll, uint dwMilliseconds);
+
+ #endregion
+ }
+}
#endif
\ No newline at end of file
diff --git a/ThirdParty/SmartThreadPool/EventWaitHandleFactory.cs b/ThirdParty/SmartThreadPool/EventWaitHandleFactory.cs
index 2f8c55b098..3c9c849205 100644
--- a/ThirdParty/SmartThreadPool/EventWaitHandleFactory.cs
+++ b/ThirdParty/SmartThreadPool/EventWaitHandleFactory.cs
@@ -1,82 +1,82 @@
-using System.Threading;
-
-#if (_WINDOWS_CE)
-using System;
-using System.Runtime.InteropServices;
-#endif
-
-namespace Amib.Threading.Internal
-{
- ///
- /// EventWaitHandleFactory class.
- /// This is a static class that creates AutoResetEvent and ManualResetEvent objects.
- /// In WindowCE the WaitForMultipleObjects API fails to use the Handle property
- /// of XxxResetEvent. It can use only handles that were created by the CreateEvent API.
- /// Consequently this class creates the needed XxxResetEvent and replaces the handle if
- /// it's a WindowsCE OS.
- ///
- public static class EventWaitHandleFactory
- {
- ///
- /// Create a new AutoResetEvent object
- ///
- /// Return a new AutoResetEvent object
- public static AutoResetEvent CreateAutoResetEvent()
- {
- AutoResetEvent waitHandle = new AutoResetEvent(false);
-
-#if (_WINDOWS_CE)
- ReplaceEventHandle(waitHandle, false, false);
-#endif
-
- return waitHandle;
- }
-
- ///
- /// Create a new ManualResetEvent object
- ///
- /// Return a new ManualResetEvent object
- public static ManualResetEvent CreateManualResetEvent(bool initialState)
- {
- ManualResetEvent waitHandle = new ManualResetEvent(initialState);
-
-#if (_WINDOWS_CE)
- ReplaceEventHandle(waitHandle, true, initialState);
-#endif
-
- return waitHandle;
- }
-
-#if (_WINDOWS_CE)
-
- ///
- /// Replace the event handle
- ///
- /// The WaitHandle object which its handle needs to be replaced.
- /// Indicates if the event is a ManualResetEvent (true) or an AutoResetEvent (false)
- /// The initial state of the event
- private static void ReplaceEventHandle(WaitHandle waitHandle, bool manualReset, bool initialState)
- {
- // Store the old handle
- IntPtr oldHandle = waitHandle.Handle;
-
- // Create a new event
- IntPtr newHandle = CreateEvent(IntPtr.Zero, manualReset, initialState, null);
-
- // Replace the old event with the new event
- waitHandle.Handle = newHandle;
-
- // Close the old event
- CloseHandle (oldHandle);
- }
-
- [DllImport("coredll.dll", SetLastError = true)]
- public static extern IntPtr CreateEvent(IntPtr lpEventAttributes, bool bManualReset, bool bInitialState, string lpName);
-
- //Handle
- [DllImport("coredll.dll", SetLastError = true)]
- public static extern bool CloseHandle(IntPtr hObject);
-#endif
-
- }
-}
+using System.Threading;
+
+#if (_WINDOWS_CE)
+using System;
+using System.Runtime.InteropServices;
+#endif
+
+namespace Amib.Threading.Internal
+{
+ ///
+ /// EventWaitHandleFactory class.
+ /// This is a static class that creates AutoResetEvent and ManualResetEvent objects.
+ /// In WindowCE the WaitForMultipleObjects API fails to use the Handle property
+ /// of XxxResetEvent. It can use only handles that were created by the CreateEvent API.
+ /// Consequently this class creates the needed XxxResetEvent and replaces the handle if
+ /// it's a WindowsCE OS.
+ ///
+ public static class EventWaitHandleFactory
+ {
+ ///
+ /// Create a new AutoResetEvent object
+ ///
+ /// Return a new AutoResetEvent object
+ public static AutoResetEvent CreateAutoResetEvent()
+ {
+ AutoResetEvent waitHandle = new AutoResetEvent(false);
+
+#if (_WINDOWS_CE)
+ ReplaceEventHandle(waitHandle, false, false);
+#endif
+
+ return waitHandle;
+ }
+
+ ///
+ /// Create a new ManualResetEvent object
+ ///
+ /// Return a new ManualResetEvent object
+ public static ManualResetEvent CreateManualResetEvent(bool initialState)
+ {
+ ManualResetEvent waitHandle = new ManualResetEvent(initialState);
+
+#if (_WINDOWS_CE)
+ ReplaceEventHandle(waitHandle, true, initialState);
+#endif
+
+ return waitHandle;
+ }
+
+#if (_WINDOWS_CE)
+
+ ///
+ /// Replace the event handle
+ ///
+ /// The WaitHandle object which its handle needs to be replaced.
+ /// Indicates if the event is a ManualResetEvent (true) or an AutoResetEvent (false)
+ /// The initial state of the event
+ private static void ReplaceEventHandle(WaitHandle waitHandle, bool manualReset, bool initialState)
+ {
+ // Store the old handle
+ IntPtr oldHandle = waitHandle.Handle;
+
+ // Create a new event
+ IntPtr newHandle = CreateEvent(IntPtr.Zero, manualReset, initialState, null);
+
+ // Replace the old event with the new event
+ waitHandle.Handle = newHandle;
+
+ // Close the old event
+ CloseHandle (oldHandle);
+ }
+
+ [DllImport("coredll.dll", SetLastError = true)]
+ public static extern IntPtr CreateEvent(IntPtr lpEventAttributes, bool bManualReset, bool bInitialState, string lpName);
+
+ //Handle
+ [DllImport("coredll.dll", SetLastError = true)]
+ public static extern bool CloseHandle(IntPtr hObject);
+#endif
+
+ }
+}
diff --git a/ThirdParty/SmartThreadPool/Exceptions.cs b/ThirdParty/SmartThreadPool/Exceptions.cs
index 8e66ce9c84..6c6a88bab1 100644
--- a/ThirdParty/SmartThreadPool/Exceptions.cs
+++ b/ThirdParty/SmartThreadPool/Exceptions.cs
@@ -1,111 +1,111 @@
-using System;
-#if !(_WINDOWS_CE)
-using System.Runtime.Serialization;
-#endif
-
-namespace Amib.Threading
-{
- #region Exceptions
-
- ///
- /// Represents an exception in case IWorkItemResult.GetResult has been canceled
- ///
- public sealed partial class WorkItemCancelException : Exception
- {
- public WorkItemCancelException()
- {
- }
-
- public WorkItemCancelException(string message)
- : base(message)
- {
- }
-
- public WorkItemCancelException(string message, Exception e)
- : base(message, e)
- {
- }
- }
-
- ///
- /// Represents an exception in case IWorkItemResult.GetResult has been timed out
- ///
- public sealed partial class WorkItemTimeoutException : Exception
- {
- public WorkItemTimeoutException()
- {
- }
-
- public WorkItemTimeoutException(string message)
- : base(message)
- {
- }
-
- public WorkItemTimeoutException(string message, Exception e)
- : base(message, e)
- {
- }
- }
-
- ///
- /// Represents an exception in case IWorkItemResult.GetResult has been timed out
- ///
- public sealed partial class WorkItemResultException : Exception
- {
- public WorkItemResultException()
- {
- }
-
- public WorkItemResultException(string message)
- : base(message)
- {
- }
-
- public WorkItemResultException(string message, Exception e)
- : base(message, e)
- {
- }
- }
-
-
-#if !(_WINDOWS_CE) && !(_SILVERLIGHT) && !(WINDOWS_PHONE)
- ///
- /// Represents an exception in case IWorkItemResult.GetResult has been canceled
- ///
- [Serializable]
- public sealed partial class WorkItemCancelException
- {
- public WorkItemCancelException(SerializationInfo si, StreamingContext sc)
- : base(si, sc)
- {
- }
- }
-
- ///
- /// Represents an exception in case IWorkItemResult.GetResult has been timed out
- ///
- [Serializable]
- public sealed partial class WorkItemTimeoutException
- {
- public WorkItemTimeoutException(SerializationInfo si, StreamingContext sc)
- : base(si, sc)
- {
- }
- }
-
- ///
- /// Represents an exception in case IWorkItemResult.GetResult has been timed out
- ///
- [Serializable]
- public sealed partial class WorkItemResultException
- {
- public WorkItemResultException(SerializationInfo si, StreamingContext sc)
- : base(si, sc)
- {
- }
- }
-
-#endif
-
- #endregion
-}
+using System;
+#if !(_WINDOWS_CE)
+using System.Runtime.Serialization;
+#endif
+
+namespace Amib.Threading
+{
+ #region Exceptions
+
+ ///
+ /// Represents an exception in case IWorkItemResult.GetResult has been canceled
+ ///
+ public sealed partial class WorkItemCancelException : Exception
+ {
+ public WorkItemCancelException()
+ {
+ }
+
+ public WorkItemCancelException(string message)
+ : base(message)
+ {
+ }
+
+ public WorkItemCancelException(string message, Exception e)
+ : base(message, e)
+ {
+ }
+ }
+
+ ///
+ /// Represents an exception in case IWorkItemResult.GetResult has been timed out
+ ///
+ public sealed partial class WorkItemTimeoutException : Exception
+ {
+ public WorkItemTimeoutException()
+ {
+ }
+
+ public WorkItemTimeoutException(string message)
+ : base(message)
+ {
+ }
+
+ public WorkItemTimeoutException(string message, Exception e)
+ : base(message, e)
+ {
+ }
+ }
+
+ ///
+ /// Represents an exception in case IWorkItemResult.GetResult has been timed out
+ ///
+ public sealed partial class WorkItemResultException : Exception
+ {
+ public WorkItemResultException()
+ {
+ }
+
+ public WorkItemResultException(string message)
+ : base(message)
+ {
+ }
+
+ public WorkItemResultException(string message, Exception e)
+ : base(message, e)
+ {
+ }
+ }
+
+
+#if !(_WINDOWS_CE) && !(_SILVERLIGHT) && !(WINDOWS_PHONE)
+ ///
+ /// Represents an exception in case IWorkItemResult.GetResult has been canceled
+ ///
+ [Serializable]
+ public sealed partial class WorkItemCancelException
+ {
+ public WorkItemCancelException(SerializationInfo si, StreamingContext sc)
+ : base(si, sc)
+ {
+ }
+ }
+
+ ///
+ /// Represents an exception in case IWorkItemResult.GetResult has been timed out
+ ///
+ [Serializable]
+ public sealed partial class WorkItemTimeoutException
+ {
+ public WorkItemTimeoutException(SerializationInfo si, StreamingContext sc)
+ : base(si, sc)
+ {
+ }
+ }
+
+ ///
+ /// Represents an exception in case IWorkItemResult.GetResult has been timed out
+ ///
+ [Serializable]
+ public sealed partial class WorkItemResultException
+ {
+ public WorkItemResultException(SerializationInfo si, StreamingContext sc)
+ : base(si, sc)
+ {
+ }
+ }
+
+#endif
+
+ #endregion
+}
diff --git a/ThirdParty/SmartThreadPool/Interfaces.cs b/ThirdParty/SmartThreadPool/Interfaces.cs
index 29c8a3e766..513422ff9f 100644
--- a/ThirdParty/SmartThreadPool/Interfaces.cs
+++ b/ThirdParty/SmartThreadPool/Interfaces.cs
@@ -1,628 +1,628 @@
-using System;
-using System.Threading;
-
-namespace Amib.Threading
-{
- #region Delegates
-
- ///
- /// A delegate that represents the method to run as the work item
- ///
- /// A state object for the method to run
- public delegate object WorkItemCallback(object state);
-
- ///
- /// A delegate to call after the WorkItemCallback completed
- ///
- /// The work item result object
- public delegate void PostExecuteWorkItemCallback(IWorkItemResult wir);
-
- ///
- /// A delegate to call after the WorkItemCallback completed
- ///
- /// The work item result object
- public delegate void PostExecuteWorkItemCallback(IWorkItemResult wir);
-
- ///
- /// A delegate to call when a WorkItemsGroup becomes idle
- ///
- /// A reference to the WorkItemsGroup that became idle
- public delegate void WorkItemsGroupIdleHandler(IWorkItemsGroup workItemsGroup);
-
- ///
- /// A delegate to call after a thread is created, but before
- /// it's first use.
- ///
- public delegate void ThreadInitializationHandler();
-
- ///
- /// A delegate to call when a thread is about to exit, after
- /// it is no longer belong to the pool.
- ///
- public delegate void ThreadTerminationHandler();
-
- #endregion
-
- #region WorkItem Priority
-
- ///
- /// Defines the availeable priorities of a work item.
- /// The higher the priority a work item has, the sooner
- /// it will be executed.
- ///
- public enum WorkItemPriority
- {
- Lowest,
- BelowNormal,
- Normal,
- AboveNormal,
- Highest,
- }
-
- #endregion
-
- #region IWorkItemsGroup interface
-
- ///
- /// IWorkItemsGroup interface
- /// Created by SmartThreadPool.CreateWorkItemsGroup()
- ///
- public interface IWorkItemsGroup
- {
- ///
- /// Get/Set the name of the WorkItemsGroup
- ///
- string Name { get; set; }
-
- ///
- /// Get/Set the maximum number of workitem that execute cocurrency on the thread pool
- ///
- int Concurrency { get; set; }
-
- ///
- /// Get the number of work items waiting in the queue.
- ///
- int WaitingCallbacks { get; }
-
- ///
- /// Get an array with all the state objects of the currently running items.
- /// The array represents a snap shot and impact performance.
- ///
- object[] GetStates();
-
- ///
- /// Get the WorkItemsGroup start information
- ///
- WIGStartInfo WIGStartInfo { get; }
-
- ///
- /// Starts to execute work items
- ///
- void Start();
-
- ///
- /// Cancel all the work items.
- /// Same as Cancel(false)
- ///
- void Cancel();
-
- ///
- /// Cancel all work items using thread abortion
- ///
- /// True to stop work items by raising ThreadAbortException
- void Cancel(bool abortExecution);
-
- ///
- /// Wait for all work item to complete.
- ///
- void WaitForIdle();
-
- ///
- /// Wait for all work item to complete, until timeout expired
- ///
- /// How long to wait for the work items to complete
- /// Returns true if work items completed within the timeout, otherwise false.
- bool WaitForIdle(TimeSpan timeout);
-
- ///
- /// Wait for all work item to complete, until timeout expired
- ///
- /// How long to wait for the work items to complete in milliseconds
- /// Returns true if work items completed within the timeout, otherwise false.
- bool WaitForIdle(int millisecondsTimeout);
-
- ///
- /// IsIdle is true when there are no work items running or queued.
- ///
- bool IsIdle { get; }
-
- ///
- /// This event is fired when all work items are completed.
- /// (When IsIdle changes to true)
- /// This event only work on WorkItemsGroup. On SmartThreadPool
- /// it throws the NotImplementedException.
- ///
- event WorkItemsGroupIdleHandler OnIdle;
-
- #region QueueWorkItem
-
- ///
- /// Queue a work item
- ///
- /// A callback to execute
- /// Returns a work item result
- IWorkItemResult QueueWorkItem(WorkItemCallback callback);
-
- ///
- /// Queue a work item
- ///
- /// A callback to execute
- /// The priority of the work item
- /// Returns a work item result
- IWorkItemResult QueueWorkItem(WorkItemCallback callback, WorkItemPriority workItemPriority);
-
- ///
- /// Queue a work item
- ///
- /// A callback to execute
- ///
- /// The context object of the work item. Used for passing arguments to the work item.
- ///
- /// Returns a work item result
- IWorkItemResult QueueWorkItem(WorkItemCallback callback, object state);
-
- ///
- /// Queue a work item
- ///
- /// A callback to execute
- ///
- /// The context object of the work item. Used for passing arguments to the work item.
- ///
- /// The work item priority
- /// Returns a work item result
- IWorkItemResult QueueWorkItem(WorkItemCallback callback, object state, WorkItemPriority workItemPriority);
-
- ///
- /// Queue a work item
- ///
- /// A callback to execute
- ///
- /// The context object of the work item. Used for passing arguments to the work item.
- ///
- ///
- /// A delegate to call after the callback completion
- ///
- /// Returns a work item result
- IWorkItemResult QueueWorkItem(WorkItemCallback callback, object state, PostExecuteWorkItemCallback postExecuteWorkItemCallback);
-
- ///
- /// Queue a work item
- ///
- /// A callback to execute
- ///
- /// The context object of the work item. Used for passing arguments to the work item.
- ///
- ///
- /// A delegate to call after the callback completion
- ///
- /// The work item priority
- /// Returns a work item result
- IWorkItemResult QueueWorkItem(WorkItemCallback callback, object state, PostExecuteWorkItemCallback postExecuteWorkItemCallback, WorkItemPriority workItemPriority);
-
- ///
- /// Queue a work item
- ///
- /// A callback to execute
- ///
- /// The context object of the work item. Used for passing arguments to the work item.
- ///
- ///
- /// A delegate to call after the callback completion
- ///
- /// Indicates on which cases to call to the post execute callback
- /// Returns a work item result
- IWorkItemResult QueueWorkItem(WorkItemCallback callback, object state, PostExecuteWorkItemCallback postExecuteWorkItemCallback, CallToPostExecute callToPostExecute);
-
- ///
- /// Queue a work item
- ///
- /// A callback to execute
- ///
- /// The context object of the work item. Used for passing arguments to the work item.
- ///
- ///
- /// A delegate to call after the callback completion
- ///
- /// Indicates on which cases to call to the post execute callback
- /// The work item priority
- /// Returns a work item result
- IWorkItemResult QueueWorkItem(WorkItemCallback callback, object state, PostExecuteWorkItemCallback postExecuteWorkItemCallback, CallToPostExecute callToPostExecute, WorkItemPriority workItemPriority);
-
- ///
- /// Queue a work item
- ///
- /// Work item info
- /// A callback to execute
- /// Returns a work item result
- IWorkItemResult QueueWorkItem(WorkItemInfo workItemInfo, WorkItemCallback callback);
-
- ///
- /// Queue a work item
- ///
- /// Work item information
- /// A callback to execute
- ///
- /// The context object of the work item. Used for passing arguments to the work item.
- ///
- /// Returns a work item result
- IWorkItemResult QueueWorkItem(WorkItemInfo workItemInfo, WorkItemCallback callback, object state);
-
- #endregion
-
- #region QueueWorkItem(Action<...>)
-
- ///
- /// Queue a work item.
- ///
- /// Returns a IWorkItemResult object, but its GetResult() will always return null
- IWorkItemResult QueueWorkItem(Action action);
-
- ///
- /// Queue a work item.
- ///
- /// Returns a IWorkItemResult object, but its GetResult() will always return null
- IWorkItemResult QueueWorkItem (Action action, WorkItemPriority priority);
-
- ///
- /// Queue a work item.
- ///
- /// Returns a IWorkItemResult object, but its GetResult() will always return null
- IWorkItemResult QueueWorkItem (Action action, T arg, WorkItemPriority priority);
-
- ///
- /// Queue a work item.
- ///
- /// Returns a IWorkItemResult object, but its GetResult() will always return null
- IWorkItemResult QueueWorkItem (Action action, T arg);
-
- ///
- /// Queue a work item.
- ///
- /// Returns a IWorkItemResult object, but its GetResult() will always return null
- IWorkItemResult QueueWorkItem(Action action, T1 arg1, T2 arg2);
-
- ///
- /// Queue a work item.
- ///
- /// Returns a IWorkItemResult object, but its GetResult() will always return null
- IWorkItemResult QueueWorkItem (Action action, T1 arg1, T2 arg2, WorkItemPriority priority);
-
- ///
- /// Queue a work item.
- ///
- /// Returns a IWorkItemResult object, but its GetResult() will always return null
- IWorkItemResult QueueWorkItem(Action action, T1 arg1, T2 arg2, T3 arg3);
-
- ///
- /// Queue a work item.
- ///
- /// Returns a IWorkItemResult object, but its GetResult() will always return null
- IWorkItemResult QueueWorkItem (Action action, T1 arg1, T2 arg2, T3 arg3, WorkItemPriority priority);
-
- ///
- /// Queue a work item.
- ///
- /// Returns a IWorkItemResult object, but its GetResult() will always return null
- IWorkItemResult QueueWorkItem(Action action, T1 arg1, T2 arg2, T3 arg3, T4 arg4);
-
- ///
- /// Queue a work item.
- ///
- /// Returns a IWorkItemResult object, but its GetResult() will always return null
- IWorkItemResult QueueWorkItem (Action action, T1 arg1, T2 arg2, T3 arg3, T4 arg4, WorkItemPriority priority);
-
- #endregion
-
- #region QueueWorkItem(Func<...>)
-
- ///
- /// Queue a work item.
- ///
- /// Returns a IWorkItemResult<TResult> object.
- /// its GetResult() returns a TResult object
- IWorkItemResult QueueWorkItem(Func func);
-
- ///
- /// Queue a work item.
- ///
- /// Returns a IWorkItemResult<TResult> object.
- /// its GetResult() returns a TResult object
- IWorkItemResult QueueWorkItem(Func func, T arg);
-
- ///
- /// Queue a work item.
- ///
- /// Returns a IWorkItemResult<TResult> object.
- /// its GetResult() returns a TResult object
- IWorkItemResult QueueWorkItem(Func func, T1 arg1, T2 arg2);
-
- ///
- /// Queue a work item.
- ///
- /// Returns a IWorkItemResult<TResult> object.
- /// its GetResult() returns a TResult object
- IWorkItemResult QueueWorkItem(Func func, T1 arg1, T2 arg2, T3 arg3);
-
- ///
- /// Queue a work item.
- ///
- /// Returns a IWorkItemResult<TResult> object.
- /// its GetResult() returns a TResult object
- IWorkItemResult QueueWorkItem(Func func, T1 arg1, T2 arg2, T3 arg3, T4 arg4);
-
- #endregion
- }
-
- #endregion
-
- #region CallToPostExecute enumerator
-
- [Flags]
- public enum CallToPostExecute
- {
- ///
- /// Never call to the PostExecute call back
- ///
- Never = 0x00,
-
- ///
- /// Call to the PostExecute only when the work item is cancelled
- ///
- WhenWorkItemCanceled = 0x01,
-
- ///
- /// Call to the PostExecute only when the work item is not cancelled
- ///
- WhenWorkItemNotCanceled = 0x02,
-
- ///
- /// Always call to the PostExecute
- ///
- Always = WhenWorkItemCanceled | WhenWorkItemNotCanceled,
- }
-
- #endregion
-
- #region IWorkItemResult interface
-
- ///
- /// The common interface of IWorkItemResult and IWorkItemResult<T>
- ///
- public interface IWaitableResult
- {
- ///
- /// This method intent is for internal use.
- ///
- ///
- IWorkItemResult GetWorkItemResult();
-
- ///
- /// This method intent is for internal use.
- ///
- ///
- IWorkItemResult GetWorkItemResultT();
- }
-
- ///
- /// IWorkItemResult interface.
- /// Created when a WorkItemCallback work item is queued.
- ///
- public interface IWorkItemResult : IWorkItemResult