Thread.hpp 667 B

1234567891011121314151617181920212223242526272829
  1. #ifndef CORE_THREAD_HPP
  2. #define CORE_THREAD_HPP
  3. #include "core/utils/AlignedData.hpp"
  4. #include "core/utils/Check.hpp"
  5. #include "core/utils/Error.hpp"
  6. namespace Core {
  7. class Thread final {
  8. AlignedData<8, 8> thread;
  9. public:
  10. Thread();
  11. Thread(const Thread& other) = delete;
  12. Thread(Thread&& other);
  13. ~Thread();
  14. Thread& operator=(const Thread& other) = delete;
  15. Thread& operator=(Thread&& other);
  16. void swap(Thread& other);
  17. using Function = int (*)(void*);
  18. check_return Error start(Function f, void* p);
  19. check_return Error join(int* returnValue = nullptr);
  20. };
  21. }
  22. #endif