diff options
Diffstat (limited to 'xbmc/platform/posix/threads/ThreadImplPosix.cpp')
-rw-r--r-- | xbmc/platform/posix/threads/ThreadImplPosix.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/xbmc/platform/posix/threads/ThreadImplPosix.cpp b/xbmc/platform/posix/threads/ThreadImplPosix.cpp new file mode 100644 index 0000000..ae5b849 --- /dev/null +++ b/xbmc/platform/posix/threads/ThreadImplPosix.cpp @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2005-2018 Team Kodi + * This file is part of Kodi - https://kodi.tv + * + * SPDX-License-Identifier: GPL-2.0-or-later + * See LICENSES/README.md for more information. + */ + +#include "ThreadImplPosix.h" + +#include "utils/log.h" + +#include <pthread.h> + +std::unique_ptr<IThreadImpl> IThreadImpl::CreateThreadImpl(std::thread::native_handle_type handle) +{ + return std::make_unique<CThreadImplPosix>(handle); +} + +CThreadImplPosix::CThreadImplPosix(std::thread::native_handle_type handle) : IThreadImpl(handle) +{ +} + +void CThreadImplPosix::SetThreadInfo(const std::string& name) +{ +#if defined(TARGET_DARWIN) + pthread_setname_np(name.c_str()); +#endif +} + +bool CThreadImplPosix::SetPriority(const ThreadPriority& priority) +{ + CLog::Log(LOGDEBUG, "[threads] setting priority is not supported on this platform"); + return false; +} |