linux-packaging-mono/mono/tests/assembly-load-stress.cs
Xamarin Public Jenkins f3e3aab35a Imported Upstream version 4.3.2.467
Former-commit-id: 9c2cb47f45fa221e661ab616387c9cda183f283d
2016-02-22 11:00:01 -05:00

34 lines
780 B
C#

using System;
using System.Text;
using System.Globalization;
using System.Collections.Generic;
using System.Reflection;
using System.Threading;
using System.IO;
public class Tests
{
static int nloops = 1;
static int nthreads = 10;
public static void Main (String[] args) {
if (args.Length > 0)
nloops = int.Parse (args [0]);
if (args.Length > 1)
nthreads = int.Parse (args [1]);
for (int li = 0; li < nloops; ++li) {
Thread[] threads = new Thread [nthreads];
for (int i = 0; i < nthreads; ++i) {
threads [i] = new Thread (delegate () {
foreach (string s in Directory.GetFiles ("/usr/local/lib/mono/4.5", "*.dll")) {
AssemblyName.GetAssemblyName (s);
}
});
}
for (int i = 0; i < 10; ++i)
threads [i].Start ();
}
}
}