diff options
author | Melanie Thielker | 2017-01-05 19:07:37 +0000 |
---|---|---|
committer | Melanie Thielker | 2017-01-05 19:07:37 +0000 |
commit | b16abc8166c29585cb76cc55c3bdd76e5833cb4f (patch) | |
tree | 6a34f465a74b7a3a6dc00a3d7aa8dcc25ac3e3a5 /ThirdParty/SmartThreadPool/EventWaitHandle.cs | |
parent | Make it possible to disable the bakes module in the way it is described in co... (diff) | |
download | opensim-SC_OLD-b16abc8166c29585cb76cc55c3bdd76e5833cb4f.zip opensim-SC_OLD-b16abc8166c29585cb76cc55c3bdd76e5833cb4f.tar.gz opensim-SC_OLD-b16abc8166c29585cb76cc55c3bdd76e5833cb4f.tar.bz2 opensim-SC_OLD-b16abc8166c29585cb76cc55c3bdd76e5833cb4f.tar.xz |
Massive tab and trailing space cleanup
Diffstat (limited to 'ThirdParty/SmartThreadPool/EventWaitHandle.cs')
-rw-r--r-- | ThirdParty/SmartThreadPool/EventWaitHandle.cs | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/ThirdParty/SmartThreadPool/EventWaitHandle.cs b/ThirdParty/SmartThreadPool/EventWaitHandle.cs index 25be07a..b7983cd 100644 --- a/ThirdParty/SmartThreadPool/EventWaitHandle.cs +++ b/ThirdParty/SmartThreadPool/EventWaitHandle.cs | |||
@@ -36,34 +36,34 @@ namespace Amib.Threading.Internal | |||
36 | return waitHandle.WaitOne(millisecondsTimeout, exitContext); | 36 | return waitHandle.WaitOne(millisecondsTimeout, exitContext); |
37 | } | 37 | } |
38 | 38 | ||
39 | private static IntPtr[] PrepareNativeHandles(WaitHandle[] waitHandles) | 39 | private static IntPtr[] PrepareNativeHandles(WaitHandle[] waitHandles) |
40 | { | 40 | { |
41 | IntPtr[] nativeHandles = new IntPtr[waitHandles.Length]; | 41 | IntPtr[] nativeHandles = new IntPtr[waitHandles.Length]; |
42 | for (int i = 0; i < waitHandles.Length; i++) | 42 | for (int i = 0; i < waitHandles.Length; i++) |
43 | { | 43 | { |
44 | nativeHandles[i] = waitHandles[i].Handle; | 44 | nativeHandles[i] = waitHandles[i].Handle; |
45 | } | 45 | } |
46 | return nativeHandles; | 46 | return nativeHandles; |
47 | } | 47 | } |
48 | 48 | ||
49 | public static bool WaitAll(WaitHandle[] waitHandles, int millisecondsTimeout, bool exitContext) | 49 | public static bool WaitAll(WaitHandle[] waitHandles, int millisecondsTimeout, bool exitContext) |
50 | { | 50 | { |
51 | uint timeout = millisecondsTimeout < 0 ? INFINITE : (uint)millisecondsTimeout; | 51 | uint timeout = millisecondsTimeout < 0 ? INFINITE : (uint)millisecondsTimeout; |
52 | 52 | ||
53 | IntPtr[] nativeHandles = PrepareNativeHandles(waitHandles); | 53 | IntPtr[] nativeHandles = PrepareNativeHandles(waitHandles); |
54 | 54 | ||
55 | int result = WaitForMultipleObjects((uint)waitHandles.Length, nativeHandles, true, timeout); | 55 | int result = WaitForMultipleObjects((uint)waitHandles.Length, nativeHandles, true, timeout); |
56 | 56 | ||
57 | if (result == WAIT_TIMEOUT || result == WAIT_FAILED) | 57 | if (result == WAIT_TIMEOUT || result == WAIT_FAILED) |
58 | { | 58 | { |
59 | return false; | 59 | return false; |
60 | } | 60 | } |
61 | 61 | ||
62 | return true; | 62 | return true; |
63 | } | 63 | } |
64 | 64 | ||
65 | 65 | ||
66 | public static int WaitAny(WaitHandle[] waitHandles, int millisecondsTimeout, bool exitContext) | 66 | public static int WaitAny(WaitHandle[] waitHandles, int millisecondsTimeout, bool exitContext) |
67 | { | 67 | { |
68 | uint timeout = millisecondsTimeout < 0 ? INFINITE : (uint)millisecondsTimeout; | 68 | uint timeout = millisecondsTimeout < 0 ? INFINITE : (uint)millisecondsTimeout; |
69 | 69 | ||
@@ -90,7 +90,7 @@ namespace Amib.Threading.Internal | |||
90 | 90 | ||
91 | return WaitAny(waitHandles, millisecondsTimeout, false); | 91 | return WaitAny(waitHandles, millisecondsTimeout, false); |
92 | } | 92 | } |
93 | 93 | ||
94 | #endregion | 94 | #endregion |
95 | 95 | ||
96 | #region External methods | 96 | #region External methods |