Made NzThread interface mimic std::thread one

Hopefully fixed the threaded window bug


Former-commit-id: 6dc3ca2a8bee1da591a9b97d202d4b73b10be8eb
This commit is contained in:
Lynix
2012-11-29 16:51:01 +01:00
parent a2eb55e74a
commit cbc98ce3f0
7 changed files with 155 additions and 140 deletions

View File

@@ -10,29 +10,24 @@
#define NAZARA_THREADIMPL_HPP
#include <Nazara/Prerequesites.hpp>
#include <Nazara/Core/Thread.hpp>
#include <windows.h>
class NzThread;
struct NzFunctor;
class NzThreadImpl
{
friend class NzThread::Id;
public:
NzThreadImpl(NzThread* threadFunc);
~NzThreadImpl();
NzThreadImpl(NzFunctor* threadFunc);
NzThread::Id GetId() const;
bool IsCurrent() const;
void Detach();
void Join();
void Terminate();
static void Sleep(nzUInt32 time);
private:
static unsigned int __stdcall ThreadProc(void* userdata);
HANDLE m_thread;
unsigned int m_threadId;
HANDLE m_handle;
};
#endif // NAZARA_THREADIMPL_HPP