Files
compute-runtime/shared/source/os_interface/os_thread.h
Oskar Hubert Weber 1816c8eac4 fix: avoid joining thread in deferred deleter
Join thread in DllMain (which we are not aware of)
can result in hang occurring in DeferredDeleter, if the library is
freed before FreeLibraryAndExitThread call from within the worker thread,
the thread gets stuck, thus the main thread is stuck on worker->join().

Related-To: NEO-14121

Signed-off-by: Oskar Hubert Weber <oskar.hubert.weber@intel.com>
2025-04-17 16:17:42 +02:00

23 lines
436 B
C++

/*
* Copyright (C) 2020-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include <memory>
namespace NEO {
class Thread {
static std::unique_ptr<Thread> create(void *(*func)(void *), void *arg);
public:
static decltype(&Thread::create) createFunc;
virtual void join() = 0;
virtual void detach() = 0;
virtual ~Thread() = default;
virtual void yield() = 0;
};
} // namespace NEO