Ejemplo n.º 1
0
        public CThread(int iterations, ThreadFunc func, object oParam, ITestOutputHelper output)
        {
            //Note: notice there are no "setters" on this class, so you can't reuse this class
            //for other thread functions, you need one class per thread function.  This is exaclty
            //how the System.Thread class works, you can't reuse it, once the thread is complete, its done
            //so all the state set is for that thread...

            _rThread = new Thread(new ThreadStart(InternalThreadStart));
            _threadfunc = func;
            _nIterations = iterations;
            _oParam = oParam;
            _output = output;
        }
Ejemplo n.º 2
0
		public		virtual void		    Add(int threads, int iterations, ThreadFunc func, object param)
		{
			for(int i=0; i<threads; i++)
				Add(new TestThread(iterations, func, param));
		}
Ejemplo n.º 3
0
		public		virtual void		    Add(int threads, ThreadFunc func, object param)
		{
			//Default to one iteration
			Add(threads, 1, func, param);
		}
Ejemplo n.º 4
0
		public		virtual void		    Add(ThreadFunc func, object param)
		{
			Add(1, func, param);
		}
Ejemplo n.º 5
0
		public	TestThread(int iterations, ThreadFunc func, object param)
		{
			//Note: notice there are no "setters" on this class, so you can't reuse this class
			//for other thread functions, you need one class per thread function.  This is exaclty 
			//how the System.Thread class works, you can't reuse it, once the thread is complete, its done
			//so all the state set is for that thread...
		
			_thread		    = new Thread(new ThreadStart(InternalThreadStart));
			_func	        = func;
			_iterations	    = iterations;
			_param		    = param;
		}
Ejemplo n.º 6
0
		//Constructor
		public	TestThread(ThreadFunc func, object param)
			: this(1, func, param)
		{
			//Default to 1 iteration
		}
Ejemplo n.º 7
0
 //Constructor
 public CThread(ThreadFunc func, object oParam, ITestOutputHelper output)
     : this(1, func, oParam, output)
 {
     //Default to 1 iteration
 }
Ejemplo n.º 8
0
 public void Add(int cThreads, int iterations, ThreadFunc func, object oParam)
 {
     for (int i = 0; i < cThreads; i++)
         Add(new CThread(iterations, func, oParam, _output));
 }
Ejemplo n.º 9
0
 public void Add(int cThreads, ThreadFunc func, object oParam)
 {
     //Default to one iteration
     Add(cThreads, 1, func, oParam);
 }
Ejemplo n.º 10
0
 public void Add(ThreadFunc func, object oParam)
 {
     Add(1, func, oParam);
 }