#pragma once #include #ifdef _WIN32 #define NOMINMAX #define WIN32_LEAN_AND_MEAN #include #include #else #include #ifndef _POSIX_THREADS #error unsupported platform (no pthreads?) #endif #include #endif void setCurrentThreadName(const char *name); /* class thread { private: #ifdef _WIN32 typedef HANDLE thread_; #else typedef pthread_t thread_; #endif public: //void run(std::function threadFunc) { // func_ = //} void wait() { } };*/ #ifdef _WIN32 #define THREAD_HANDLE HANDLE #else #define THREAD_HANDLE pthread_t #endif // TODO: replace this abomination with std::thread class thread { public: virtual void Run(); };