EHS/include/ehs/system/Thread_LNX.h

42 lines
633 B
C++

#pragma once
#include "BaseThread.h"
#include <sys/wait.h>
namespace ehs
{
class Thread : public BaseThread
{
private:
void* stack;
pid_t hdl;
volatile bool* detached;
public:
~Thread();
Thread();
Thread(UInt_64 stackSize, void* args, UInt_32 (*func)(void*));
Thread(Thread&& thread) noexcept;
Thread(const Thread& thread);
Thread& operator=(Thread&& thread) noexcept;
Thread& operator=(const Thread& thread);
void Detach() override;
void Join() override;
static UInt_32 GetCurrentId();
static void HardSleep(UInt_32 milliseconds);
private:
static UInt_32 Redirect(void* args);
};
}