joinable_thread.hpp Source File

joinable_thread.hpp Source File#

Composable Kernel: joinable_thread.hpp Source File
joinable_thread.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: MIT
2// Copyright (c) 2018-2024, Advanced Micro Devices, Inc. All rights reserved.
3
4#pragma once
5
6#include <thread>
7#include <utility>
8
9namespace ck_tile {
10
11struct joinable_thread : std::thread
12{
13 template <typename... Xs>
14 joinable_thread(Xs&&... xs) : std::thread(std::forward<Xs>(xs)...)
15 {
16 }
17
20
22 {
23 if(this->joinable())
24 this->join();
25 }
26};
27} // namespace ck_tile
Definition tile/core/algorithm/cluster_descriptor.hpp:13
STL namespace.
joinable_thread(Xs &&... xs)
Definition joinable_thread.hpp:14
~joinable_thread()
Definition joinable_thread.hpp:21
joinable_thread & operator=(joinable_thread &&)=default
joinable_thread(joinable_thread &&)=default