Thread.cpp 501 B

12345678910111213141516
  1. #include "thread/Thread.hpp"
  2. #include <threads.h>
  3. check_return Core::Error Core::Thread::start(Function f, void* p) {
  4. ASSERT_ALIGNED_DATA(thread, thrd_t);
  5. return thrd_create(thread.as<thrd_t>(), f, p) != thrd_success
  6. ? Error::THREAD_ERROR
  7. : Error::NONE;
  8. }
  9. check_return Core::Error Core::Thread::join(int* returnValue) {
  10. return thrd_join(*thread.as<thrd_t>(), returnValue) != thrd_success
  11. ? Error::THREAD_ERROR
  12. : Error::NONE;
  13. }