Ignore SynchronizationAttribute on MT

This commit is contained in:
Marek Safar committed 2013-03-07 16:34:23 +01:00
1 parent 02482bef43
commit 93e31cbc63
1 file changed
+6 -6
@@ -371,17 +371,17 @@ namespace System.Threading
bool release = false;
try {
if (exitContext) {
#if MONOTOUCH
throw new NotSupportedException ("exitContext == true is not supported");
#else
#if !MONOTOUCH
SynchronizationAttribute.ExitContext ();
#endif
}
safe_wait_handle.DangerousAddRef (ref release);
return (WaitOne_internal(safe_wait_handle.DangerousGetHandle (), millisecondsTimeout, exitContext));
} finally {
#if !MONOTOUCH
if (exitContext)
SynchronizationAttribute.EnterContext ();
#endif
if (release)
safe_wait_handle.DangerousRelease ();
}
@@ -407,9 +407,7 @@ namespace System.Threading
bool release = false;
try {
if (exitContext) {
#if MONOTOUCH
throw new NotSupportedException ("exitContext == true is not supported");
#else
#if !MONOTOUCH
SynchronizationAttribute.ExitContext ();
#endif
}
@@ -417,8 +415,10 @@ namespace System.Threading
return (WaitOne_internal(safe_wait_handle.DangerousGetHandle (), (int) ms, exitContext));
}
finally {
#if !MONOTOUCH
if (exitContext)
SynchronizationAttribute.EnterContext ();
#endif
if (release)
safe_wait_handle.DangerousRelease ();
}