From 206fb306a7820cf593570e35ddfa8e7c5a10e449 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Wed, 1 May 2013 19:01:43 +0100
Subject: Update SmartThreadPool to latest version 2.2.3 with a major and minor
change.
SmartThreadPool code comes from http://www.codeproject.com/Articles/7933/Smart-Thread-Pool
This version implements thread abort (via WorkItem.Cancel(true)), threadpool naming, max thread stack, etc. so we no longer need to manually patch those.
However, two changes have been made to stock 2.2.3.
Major change: WorkItem.Cancel(bool abortExecution) in our version does not succeed if the work item was in progress and thread abort was not specified.
This is to match previous behaviour where we handle co-operative termination via another mechanism rather than checking WorkItem.IsCanceled.
Minor change: Did not add STP's StopWatch implementation as this is only used WinCE and Silverlight and causes a build clash with System.Diagnostics.StopWatch
The reason for updating is to see if this improves http://opensimulator.org/mantis/view.php?id=6557 and http://opensimulator.org/mantis/view.php?id=6586
---
ThirdParty/SmartThreadPool/Exceptions.cs | 192 ++++++++++++++++++-------------
1 file changed, 111 insertions(+), 81 deletions(-)
(limited to 'ThirdParty/SmartThreadPool/Exceptions.cs')
diff --git a/ThirdParty/SmartThreadPool/Exceptions.cs b/ThirdParty/SmartThreadPool/Exceptions.cs
index c454709..8e66ce9 100644
--- a/ThirdParty/SmartThreadPool/Exceptions.cs
+++ b/ThirdParty/SmartThreadPool/Exceptions.cs
@@ -1,81 +1,111 @@
-// Ami Bar
-// amibar@gmail.com
-
-using System;
-using System.Runtime.Serialization;
-
-namespace Amib.Threading
-{
- #region Exceptions
-
- ///
- /// Represents an exception in case IWorkItemResult.GetResult has been canceled
- ///
- [Serializable]
- public sealed class WorkItemCancelException : ApplicationException
- {
- public WorkItemCancelException() : base()
- {
- }
-
- public WorkItemCancelException(string message) : base(message)
- {
- }
-
- public WorkItemCancelException(string message, Exception e) : base(message, e)
- {
- }
-
- public WorkItemCancelException(SerializationInfo si, StreamingContext sc) : base(si, sc)
- {
- }
- }
-
- ///
- /// Represents an exception in case IWorkItemResult.GetResult has been timed out
- ///
- [Serializable]
- public sealed class WorkItemTimeoutException : ApplicationException
- {
- public WorkItemTimeoutException() : base()
- {
- }
-
- public WorkItemTimeoutException(string message) : base(message)
- {
- }
-
- public WorkItemTimeoutException(string message, Exception e) : base(message, e)
- {
- }
-
- public WorkItemTimeoutException(SerializationInfo si, StreamingContext sc) : base(si, sc)
- {
- }
- }
-
- ///
- /// Represents an exception in case IWorkItemResult.GetResult has been timed out
- ///
- [Serializable]
- public sealed class WorkItemResultException : ApplicationException
- {
- public WorkItemResultException() : base()
- {
- }
-
- public WorkItemResultException(string message) : base(message)
- {
- }
-
- public WorkItemResultException(string message, Exception e) : base(message, e)
- {
- }
-
- public WorkItemResultException(SerializationInfo si, StreamingContext sc) : base(si, sc)
- {
- }
- }
-
- #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
+}
--
cgit v1.1
From 854dcd1abddc3eef33da953592deb61133e5e7ed Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Wed, 1 May 2013 23:00:46 +0100
Subject: Fix SmartThreadPool line endings in recent update from dos to unix
---
ThirdParty/SmartThreadPool/Exceptions.cs | 222 +++++++++++++++----------------
1 file changed, 111 insertions(+), 111 deletions(-)
(limited to 'ThirdParty/SmartThreadPool/Exceptions.cs')
diff --git a/ThirdParty/SmartThreadPool/Exceptions.cs b/ThirdParty/SmartThreadPool/Exceptions.cs
index 8e66ce9..6c6a88b 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
+}
--
cgit v1.1