Commit 8babe50f by Carwyn

Fixes: 1.去除 GetThreadId 调用

parent 298b1ad8
......@@ -3,6 +3,7 @@
FMSockServer::FMSockServer(FMApiRelay *relay) :
_worker(0),
_worker_tid(0),
_port(0),
_relay(relay)
{
......@@ -44,9 +45,8 @@ FMSockServer::~FMSockServer()
VOID FMSockServer::Listen(USHORT port)
{
_port = port;
DWORD tid = 0;
_worker = CreateThread(NULL, 0, FMSockServer::RecvWorker, this, 0, &tid);
FMLOG(_T("Server thread %ld started."), tid);
_worker = CreateThread(NULL, 0, FMSockServer::RecvWorker, this, 0, &_worker_tid);
FMLOG(_T("Server thread %ld started."), _worker_tid);
}
......@@ -57,7 +57,7 @@ BOOL FMSockServer::Stop()
WaitForSingleObject(_worker, INFINITE);
CloseHandle(_worker);
FMLOG(_T("Server thread %ld stopped. exit."), GetThreadId(_worker));
FMLOG(_T("Server thread %ld stopped. exit."), _worker_tid);
return TRUE;
}
......
......@@ -72,6 +72,7 @@ private:
USHORT _port;
sockaddr_in _addr_in;
HANDLE _worker;
DWORD _worker_tid;
FMApiRelay *_relay;
CRITICAL_SECTION _cs;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment