#ifndef CORE_THREAD_HPP
#define CORE_THREAD_HPP

#include <threads.h>

#include "core/utils/Check.hpp"

namespace Core {
    class Thread final {
        thrd_t thread;

    public:
        using Function = int (*)(void*);

        Thread();
        Thread(const Thread& other) = delete;
        Thread(Thread&& other);
        ~Thread();
        Thread& operator=(const Thread& other) = delete;
        Thread& operator=(Thread&& other);
        void swap(Thread& other);
        cbool start(Function f, void* p);
        cbool join(int* returnValue = nullptr);
    };
}

#endif