Files
compute-runtime/shared/source/os_interface/windows/os_thread_win.cpp
Mateusz Hoppe 0d85f6ccc7 Add yield() method to Thread
Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2021-04-20 13:32:14 +02:00

26 lines
532 B
C++

/*
* Copyright (C) 2018-2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/os_interface/windows/os_thread_win.h"
namespace NEO {
ThreadWin::ThreadWin(std::thread *thread) {
this->thread.reset(thread);
};
std::unique_ptr<Thread> Thread::create(void *(*func)(void *), void *arg) {
return std::unique_ptr<Thread>(new ThreadWin(new std::thread(func, arg)));
}
void ThreadWin::join() {
thread->join();
}
void ThreadWin::yield() {
std::this_thread::yield();
}
} // namespace NEO