Merge pull request #2932 from ludovic-henry/fix-waithandle-remoting
authormonojenkins <jo.shields+jenkins@xamarin.com>
Thu, 21 Apr 2016 06:30:26 +0000 (07:30 +0100)
committermonojenkins <jo.shields+jenkins@xamarin.com>
Thu, 21 Apr 2016 06:30:26 +0000 (07:30 +0100)
commit7f5d060b9f65444630c51e14704b1937d8346047
tree0fb84addc356f0cd762c6ca653584bc584e7bf75
parent4e9160841dcaba79747b4d2cab1eb59bfebb9839
parent06dff0b90e178736d76f7bda2ef0631e9063690e
Merge pull request #2932 from ludovic-henry/fix-waithandle-remoting

[corlib] Ifdef out calls to SynchronizationAttribute on monotouch

When WaitHandle was imported from referencesource in f6fa8f0, the code was refactored and basically all WaitHandle.Wait* calls end up in WaitOneNative or WaitMultiple now.

On monotouch those methods threw a NotSupportedException when exitContext == true even before the import, so this behavior got inherited to some other methods that didn't throw after the exception was removed from them in 93e31cb. This broke tests in maccore and other code that passed exitContext=true.

To fix this, we just ifdef out the calls to SynchronizationAttribute on monotouch since they don't make sense there anyway since remoting isn't available. The commit that initially added the exception in 2ce9fc1 only did that to make the behavior consistent when the linker is enabled. By removing the calls we get the same result.

Do the same for Monitor so we're consistent.

commit message from @akoeplinger