Merge pull request #26278 from basilgello/taglib2-fix-piers
[xbmc.git] / xbmc / threads / IThreadImpl.h
blobf631c7995d7b5b81c7d457aaabcf15e413a57ce6
1 /*
2 * Copyright (C) 2005-2022 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
9 #pragma once
11 #include "threads/Thread.h"
13 #include <memory>
14 #include <string>
15 #include <thread>
17 class IThreadImpl
19 public:
20 virtual ~IThreadImpl() = default;
22 static std::unique_ptr<IThreadImpl> CreateThreadImpl(std::thread::native_handle_type handle);
24 /*!
25 * \brief Set the thread name and other info (platform dependent)
28 virtual void SetThreadInfo(const std::string& name) = 0;
30 /*!
31 * \brief Set the thread priority via the native threading library
34 virtual bool SetPriority(const ThreadPriority& priority) = 0;
36 protected:
37 IThreadImpl(std::thread::native_handle_type handle) : m_handle(handle) {}
39 std::thread::native_handle_type m_handle;
41 private:
42 IThreadImpl() = delete;