/// <exception cref="System.Exception"></exception>
		public virtual void TestIsAliveInMultiThread()
		{
			IBlockingQueue4 barrier = new BlockingQueue();
			client = (ClientObjectContainer)OpenNewSession();
			client.MessageListener(new _IMessageListener_23(this, barrier));
			Thread workThread = new Thread(new _IRunnable_38(), "Quering");
			workThread.SetDaemon(true);
			workThread.Start();
			barrier.Next();
			client.IsAlive();
		}
 public void Run()
 {
     _thread = Sharpen.Lang.Thread.CurrentThread();
     try
     {
         SetDispatcherName(string.Empty + _threadID);
         _server.WithEnvironment(new _IRunnable_152(this));
     }
     finally
     {
         Close();
     }
 }
Esempio n. 3
0
		private Thread StartBackupThread()
		{
			Thread thread = new Thread(new _IRunnable_92(this), "BackupStressTestCase.startBackupThread"
				);
			thread.Start();
			return thread;
		}
		public ThreadedSyncBin(IBin bin) : base(bin)
		{
			_thread = new Thread(new _IRunnable_23(this), "ThreadedSyncBin");
			_thread.Start();
		}
		public void Run()
		{
			_thread = Sharpen.Lang.Thread.CurrentThread();
			try
			{
				SetDispatcherName(string.Empty + _threadID);
				_server.WithEnvironment(new _IRunnable_152(this));
			}
			finally
			{
				Close();
			}
		}
Esempio n. 6
0
 private Thread StartGetAndReleaseThread(IExtObjectContainer client)
 {
     var t = new Thread(new GetAndRelease(client), "SetSemaphoreTestCase.startGetAndReleaseThread"
         );
     t.Start();
     return t;
 }
Esempio n. 7
0
 /// <exception cref="System.Exception"></exception>
 public virtual void TestMultipleThreads()
 {
     var clients = new IExtObjectContainer[5];
     clients[0] = Db();
     for (var i = 1; i < clients.Length; i++)
     {
         clients[i] = OpenNewSession();
     }
     Assert.IsTrue(clients[1].SetSemaphore(SemaphoreName, 50));
     var threads = new Thread[clients.Length];
     for (var i = 0; i < clients.Length; i++)
     {
         threads[i] = StartGetAndReleaseThread(clients[i]);
     }
     for (var i = 0; i < threads.Length; i++)
     {
         threads[i].Join();
     }
     EnsureMessageProcessed(clients[0]);
     Assert.IsTrue(clients[0].SetSemaphore(SemaphoreName, 0));
     clients[0].Close();
     threads[2] = StartGetAndReleaseThread(clients[2]);
     threads[1] = StartGetAndReleaseThread(clients[1]);
     threads[1].Join();
     threads[2].Join();
     for (var i = 1; i < clients.Length - 1; i++)
     {
         clients[i].Close();
     }
     clients[4].SetSemaphore(SemaphoreName, 1000);
     clients[4].Close();
 }