linux-packaging-mono/mono/tests/allow-synchronous-major.cs
Jo Shields a575963da9 Imported Upstream version 3.6.0
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
2014-08-13 10:39:27 +01:00

27 lines
630 B
C#

using System;
using System.Reflection;
public class Test
{
public static int Main ()
{
var t = Type.GetType("Mono.Runtime");
if (t == null)
return 1;
var setGCAllowSynchronousMajor = (Func<bool,bool>) Delegate.CreateDelegate(typeof(Func<bool,bool>),
t,
"SetGCAllowSynchronousMajor",
ignoreCase:false,
throwOnBindFailure:false);
if (setGCAllowSynchronousMajor == null)
return 1;
if (!setGCAllowSynchronousMajor (false))
Console.WriteLine ("could not disable synchronous major");
if (!setGCAllowSynchronousMajor (true))
return 1;
return 0;
}
}