Move git root from Client/ to src/ to track all source code: - Client: Game client source (moved to Client/Client/) - Server: Game server source - GameTools: Development tools - CryptoSource: Encryption utilities - database: Database scripts - Script: Game scripts - rylCoder_16.02.2008_src: Legacy coder tools - GMFont, Game: Additional resources 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
61 lines
1.2 KiB
C++
61 lines
1.2 KiB
C++
/**
|
|
* @file NFThread.h
|
|
* @brief Auto Thread 생성 클래스
|
|
* @remarks
|
|
* @author 강동명(edith2580@gmail.com)
|
|
* @date 2009-04-02
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <windows.h>
|
|
|
|
namespace Nave {
|
|
|
|
/**
|
|
* @class NFThread
|
|
* @brief 스레드 객체 클래스
|
|
* @remarks
|
|
*
|
|
* @par
|
|
* @author Edith
|
|
* @date 2009-04-05
|
|
*/
|
|
class NFThread
|
|
{
|
|
public:
|
|
NFThread() : m_hThreadHandle(INVALID_HANDLE_VALUE)
|
|
{
|
|
}
|
|
|
|
~NFThread()
|
|
{
|
|
}
|
|
|
|
typedef unsigned int(__stdcall *LPThreadFunc)(void*);
|
|
/// 스레드 함수포인터
|
|
static inline unsigned int __stdcall ThreadFunc(void* pArg);
|
|
|
|
/// 스레드 핸들을 리턴한다.
|
|
inline HANDLE GetHandle() { return m_hThreadHandle; }
|
|
/// 스레드 핸들을 설정한다.
|
|
inline void SetHandle(HANDLE hHandle) { m_hThreadHandle = hHandle; }
|
|
|
|
/// 실제 실행 되는 루프를 넣는다.
|
|
virtual unsigned int Run() = 0;
|
|
/// 루프가 끝날 수 있는 루틴을 넣는다.
|
|
virtual BOOL End() = 0;
|
|
|
|
private:
|
|
/// 스레드핸들
|
|
HANDLE m_hThreadHandle;
|
|
|
|
// friend class NFThreadManager;
|
|
};
|
|
|
|
/// 스레드 호출함수
|
|
inline unsigned int __stdcall NFThread::ThreadFunc(void* pArg)
|
|
{
|
|
return static_cast<NFThread*>(pArg)->Run();
|
|
}
|
|
} |