diff options
author | Justin Clark-Casey (justincc) | 2013-05-01 19:01:43 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2013-05-01 19:01:43 +0100 |
commit | 206fb306a7820cf593570e35ddfa8e7c5a10e449 (patch) | |
tree | 0ef0fdf42ddc0b63224af52b62b0bad42f62e352 /ThirdParty/SmartThreadPool/Exceptions.cs | |
parent | Fix CAPS to work like they should - do not send caps to the viewer if they're... (diff) | |
download | opensim-SC_OLD-206fb306a7820cf593570e35ddfa8e7c5a10e449.zip opensim-SC_OLD-206fb306a7820cf593570e35ddfa8e7c5a10e449.tar.gz opensim-SC_OLD-206fb306a7820cf593570e35ddfa8e7c5a10e449.tar.bz2 opensim-SC_OLD-206fb306a7820cf593570e35ddfa8e7c5a10e449.tar.xz |
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
Diffstat (limited to 'ThirdParty/SmartThreadPool/Exceptions.cs')
-rw-r--r-- | ThirdParty/SmartThreadPool/Exceptions.cs | 192 |
1 files changed, 111 insertions, 81 deletions
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 @@ | |||
1 | // Ami Bar | 1 | using System; |
2 | // amibar@gmail.com | 2 | #if !(_WINDOWS_CE) |
3 | 3 | using System.Runtime.Serialization; | |
4 | using System; | 4 | #endif |
5 | using System.Runtime.Serialization; | 5 | |
6 | 6 | namespace Amib.Threading | |
7 | namespace Amib.Threading | 7 | { |
8 | { | 8 | #region Exceptions |
9 | #region Exceptions | 9 | |
10 | 10 | /// <summary> | |
11 | /// <summary> | 11 | /// Represents an exception in case IWorkItemResult.GetResult has been canceled |
12 | /// Represents an exception in case IWorkItemResult.GetResult has been canceled | 12 | /// </summary> |
13 | /// </summary> | 13 | public sealed partial class WorkItemCancelException : Exception |
14 | [Serializable] | 14 | { |
15 | public sealed class WorkItemCancelException : ApplicationException | 15 | public WorkItemCancelException() |
16 | { | 16 | { |
17 | public WorkItemCancelException() : base() | 17 | } |
18 | { | 18 | |
19 | } | 19 | public WorkItemCancelException(string message) |
20 | 20 | : base(message) | |
21 | public WorkItemCancelException(string message) : base(message) | 21 | { |
22 | { | 22 | } |
23 | } | 23 | |
24 | 24 | public WorkItemCancelException(string message, Exception e) | |
25 | public WorkItemCancelException(string message, Exception e) : base(message, e) | 25 | : base(message, e) |
26 | { | 26 | { |
27 | } | 27 | } |
28 | 28 | } | |
29 | public WorkItemCancelException(SerializationInfo si, StreamingContext sc) : base(si, sc) | 29 | |
30 | { | 30 | /// <summary> |
31 | } | 31 | /// Represents an exception in case IWorkItemResult.GetResult has been timed out |
32 | } | 32 | /// </summary> |
33 | 33 | public sealed partial class WorkItemTimeoutException : Exception | |
34 | /// <summary> | 34 | { |
35 | /// Represents an exception in case IWorkItemResult.GetResult has been timed out | 35 | public WorkItemTimeoutException() |
36 | /// </summary> | 36 | { |
37 | [Serializable] | 37 | } |
38 | public sealed class WorkItemTimeoutException : ApplicationException | 38 | |
39 | { | 39 | public WorkItemTimeoutException(string message) |
40 | public WorkItemTimeoutException() : base() | 40 | : base(message) |
41 | { | 41 | { |
42 | } | 42 | } |
43 | 43 | ||
44 | public WorkItemTimeoutException(string message) : base(message) | 44 | public WorkItemTimeoutException(string message, Exception e) |
45 | { | 45 | : base(message, e) |
46 | } | 46 | { |
47 | 47 | } | |
48 | public WorkItemTimeoutException(string message, Exception e) : base(message, e) | 48 | } |
49 | { | 49 | |
50 | } | 50 | /// <summary> |
51 | 51 | /// Represents an exception in case IWorkItemResult.GetResult has been timed out | |
52 | public WorkItemTimeoutException(SerializationInfo si, StreamingContext sc) : base(si, sc) | 52 | /// </summary> |
53 | { | 53 | public sealed partial class WorkItemResultException : Exception |
54 | } | 54 | { |
55 | } | 55 | public WorkItemResultException() |
56 | 56 | { | |
57 | /// <summary> | 57 | } |
58 | /// Represents an exception in case IWorkItemResult.GetResult has been timed out | 58 | |
59 | /// </summary> | 59 | public WorkItemResultException(string message) |
60 | [Serializable] | 60 | : base(message) |
61 | public sealed class WorkItemResultException : ApplicationException | 61 | { |
62 | { | 62 | } |
63 | public WorkItemResultException() : base() | 63 | |
64 | { | 64 | public WorkItemResultException(string message, Exception e) |
65 | } | 65 | : base(message, e) |
66 | 66 | { | |
67 | public WorkItemResultException(string message) : base(message) | 67 | } |
68 | { | 68 | } |
69 | } | 69 | |
70 | 70 | ||
71 | public WorkItemResultException(string message, Exception e) : base(message, e) | 71 | #if !(_WINDOWS_CE) && !(_SILVERLIGHT) && !(WINDOWS_PHONE) |
72 | { | 72 | /// <summary> |
73 | } | 73 | /// Represents an exception in case IWorkItemResult.GetResult has been canceled |
74 | 74 | /// </summary> | |
75 | public WorkItemResultException(SerializationInfo si, StreamingContext sc) : base(si, sc) | 75 | [Serializable] |
76 | { | 76 | public sealed partial class WorkItemCancelException |
77 | } | 77 | { |
78 | } | 78 | public WorkItemCancelException(SerializationInfo si, StreamingContext sc) |
79 | 79 | : base(si, sc) | |
80 | #endregion | 80 | { |
81 | } | 81 | } |
82 | } | ||
83 | |||
84 | /// <summary> | ||
85 | /// Represents an exception in case IWorkItemResult.GetResult has been timed out | ||
86 | /// </summary> | ||
87 | [Serializable] | ||
88 | public sealed partial class WorkItemTimeoutException | ||
89 | { | ||
90 | public WorkItemTimeoutException(SerializationInfo si, StreamingContext sc) | ||
91 | : base(si, sc) | ||
92 | { | ||
93 | } | ||
94 | } | ||
95 | |||
96 | /// <summary> | ||
97 | /// Represents an exception in case IWorkItemResult.GetResult has been timed out | ||
98 | /// </summary> | ||
99 | [Serializable] | ||
100 | public sealed partial class WorkItemResultException | ||
101 | { | ||
102 | public WorkItemResultException(SerializationInfo si, StreamingContext sc) | ||
103 | : base(si, sc) | ||
104 | { | ||
105 | } | ||
106 | } | ||
107 | |||
108 | #endif | ||
109 | |||
110 | #endregion | ||
111 | } | ||