mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-20 00:24:58 +08:00
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>
23 lines
436 B
C++
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
|