C# Class NSoft.NFramework.Threading.AbstractWorkerThread

Inheritance: AbstractThread
显示文件 Open project: debop/NFramework

Public Methods

Method Description
Interrupt ( ) : void

스레드를 중지시킵니다.

Run ( ) : void

Two-phase termination이 가능하도록 내부에서 항상 shutdown요청을 감시하면서 단위작업을 수행한다. ThreadInterruptedException이 발생해도 내부적으로 무시하고 진행한다.

ShutDown ( ) : void

InternalThread 중지를 요청합니다.

Protected Methods

Method Description
AbstractWorkerThread ( ) : System

생성자

AbstractWorkerThread ( int maxStackSize ) : System

생성자

AbstractWorkerThread ( string name ) : System

생성자

AbstractWorkerThread ( string name, int maxStackSize ) : System

생성자

DoShutDown ( ) : void

종료 요청시 뒷 정리를 담당하는 함수입니다. 뒷 정리에 관련된 내용을 구현해야 합니다.

DoWork ( ) : void

InternalThread 내에서 작업하고자 하는 코드를 구현한다. AbstractWorkerThread.RunEach() 메소드에서 Shutdown 요청이 들어오기 전까지는 반복적으로 DoWork 메소드를 호출하므로, 실제 작업하고자 하는 단위 작업만 작성하면 됩니다.

OnShutDownRequested ( ) : void

스레드가 종료되었을 시 호출되는 함수. 내부적으로 AbstractWorkerThread.ShutDownRequested 이벤트를 호출한다.

Private Methods

Method Description
OnShutDowned ( ) : void

Method Details

AbstractWorkerThread() protected method

생성자
protected AbstractWorkerThread ( ) : System
return System

AbstractWorkerThread() protected method

생성자
protected AbstractWorkerThread ( int maxStackSize ) : System
maxStackSize int 스레드가 사용할 최대 Stack 크기
return System

AbstractWorkerThread() protected method

생성자
protected AbstractWorkerThread ( string name ) : System
name string 스레드 이름
return System

AbstractWorkerThread() protected method

생성자
protected AbstractWorkerThread ( string name, int maxStackSize ) : System
name string 스레드 이름
maxStackSize int 스레드가 사용할 최대 Stack 크기
return System

DoShutDown() protected abstract method

종료 요청시 뒷 정리를 담당하는 함수입니다. 뒷 정리에 관련된 내용을 구현해야 합니다.
protected abstract DoShutDown ( ) : void
return void

DoWork() protected abstract method

InternalThread 내에서 작업하고자 하는 코드를 구현한다. AbstractWorkerThread.RunEach() 메소드에서 Shutdown 요청이 들어오기 전까지는 반복적으로 DoWork 메소드를 호출하므로, 실제 작업하고자 하는 단위 작업만 작성하면 됩니다.
protected abstract DoWork ( ) : void
return void

Interrupt() public method

스레드를 중지시킵니다.
public Interrupt ( ) : void
return void

OnShutDownRequested() protected method

스레드가 종료되었을 시 호출되는 함수. 내부적으로 AbstractWorkerThread.ShutDownRequested 이벤트를 호출한다.
protected OnShutDownRequested ( ) : void
return void

Run() public method

Two-phase termination이 가능하도록 내부에서 항상 shutdown요청을 감시하면서 단위작업을 수행한다. ThreadInterruptedException이 발생해도 내부적으로 무시하고 진행한다.
public Run ( ) : void
return void

ShutDown() public method

InternalThread 중지를 요청합니다.
public ShutDown ( ) : void
return void