move definition of flushthread to more sensible place

This commit is contained in:
Akash Mozumdar 2018-06-10 20:35:24 -04:00
parent 27fa8c7db7
commit b6a43e7283
2 changed files with 10 additions and 11 deletions

View File

@ -1,6 +1,15 @@
#include "TextBuffer.h" #include "TextBuffer.h"
DWORD WINAPI FlushThread(LPVOID lParam); // window.cpp DWORD WINAPI FlushThread(LPVOID lParam)
{
TextBuffer* t = (TextBuffer*)lParam;
while (t->Running())
{
t->Flush();
Sleep(10);
}
return 0;
}
TextBuffer::TextBuffer(HWND edit) : hThread(IthCreateThread(FlushThread, (DWORD)this)), TextBuffer::TextBuffer(HWND edit) : hThread(IthCreateThread(FlushThread, (DWORD)this)),
hEdit(edit), hEdit(edit),

View File

@ -806,13 +806,3 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
return 0; return 0;
} }
DWORD WINAPI FlushThread(LPVOID lParam)
{
TextBuffer* t = (TextBuffer*)lParam;
while (t->Running())
{
t->Flush();
Sleep(10);
}
return 0;
}