Major upgrade
This commit is contained in:
@@ -16,22 +16,10 @@ GOVERNMENT.
|
||||
UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY.
|
||||
-------------------------------------------------------------------------*/
|
||||
|
||||
using System;
|
||||
using ProgramLib;
|
||||
using Raytheon.Common;
|
||||
|
||||
namespace ProgramLib
|
||||
{
|
||||
internal abstract class BasicTest
|
||||
internal abstract class BasicAction
|
||||
{
|
||||
protected abstract void CheckPrerequisite();
|
||||
|
||||
protected abstract void ExecuteTest();
|
||||
|
||||
public void RunTest()
|
||||
{
|
||||
CheckPrerequisite();
|
||||
ExecuteTest();
|
||||
}
|
||||
abstract public void Run();
|
||||
}
|
||||
}
|
||||
@@ -15,12 +15,7 @@ GOVERNMENT.
|
||||
|
||||
UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY.
|
||||
-------------------------------------------------------------------------*/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProgramLib
|
||||
{
|
||||
@@ -31,12 +26,14 @@ namespace ProgramLib
|
||||
{
|
||||
protected Thread _thread;
|
||||
|
||||
protected ManualResetEvent _quitEvent = new ManualResetEvent(false);
|
||||
|
||||
/// <summary>
|
||||
/// Spawn thread and start it
|
||||
/// </summary>
|
||||
/// <param name=""></param>
|
||||
/// <returns></returns>
|
||||
public void Start()
|
||||
public void Start()
|
||||
{
|
||||
_thread = new Thread(new ThreadStart(DoWork));
|
||||
_thread.Start();
|
||||
@@ -55,15 +52,18 @@ namespace ProgramLib
|
||||
/// </summary>
|
||||
/// <param name=""></param>
|
||||
/// <returns></returns>
|
||||
public virtual void Quit() { }
|
||||
public virtual void Quit()
|
||||
{
|
||||
_quitEvent.Set();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Wait for thread to exit
|
||||
/// </summary>
|
||||
/// <param name=""></param>
|
||||
/// <returns></returns>
|
||||
public virtual void WaitForExit()
|
||||
{
|
||||
public virtual void WaitForExit()
|
||||
{
|
||||
if (_thread != null)
|
||||
{
|
||||
// wait for thread to terminate
|
||||
|
||||
Reference in New Issue
Block a user