diff --git a/Common/CMakeLists.txt b/Common/CMakeLists.txt index 7588aa4277..707a1a0706 100644 --- a/Common/CMakeLists.txt +++ b/Common/CMakeLists.txt @@ -69,7 +69,6 @@ add_library(Common STATIC Data/Collections/FastVec.h Data/Collections/CharQueue.h Data/Collections/CyclicBuffer.h - Data/Collections/ThreadSafeList.h Data/Color/RGBAUtil.cpp Data/Color/RGBAUtil.h Data/Convert/ColorConv.cpp diff --git a/Common/Common.vcxproj b/Common/Common.vcxproj index d03f6a5365..2073591ccd 100644 --- a/Common/Common.vcxproj +++ b/Common/Common.vcxproj @@ -391,7 +391,6 @@ - diff --git a/Common/Common.vcxproj.filters b/Common/Common.vcxproj.filters index a37ca9f313..829d6ec115 100644 --- a/Common/Common.vcxproj.filters +++ b/Common/Common.vcxproj.filters @@ -338,9 +338,6 @@ Data\Collections - - Data\Collections - GPU diff --git a/Common/Data/Collections/ThreadSafeList.h b/Common/Data/Collections/ThreadSafeList.h deleted file mode 100644 index 9697438bb9..0000000000 --- a/Common/Data/Collections/ThreadSafeList.h +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) 2015- PPSSPP Project. - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, version 2.0 or later versions. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License 2.0 for more details. - -// A copy of the GPL 2.0 should have been included with the program. -// If not, see http://www.gnu.org/licenses/ - -// Official git repository and contact information can be found at -// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. - -#pragma once - -#include - -template < typename T, class Alloc = std::allocator > -class ThreadSafeList { -public: - explicit ThreadSafeList(const Alloc &a = Alloc()) : list(a) {} - explicit ThreadSafeList(std::size_t n, const T &v = T(), const Alloc &a = Alloc()) : list(n, v, a) {} - ThreadSafeList(const std::list &other) : list(other) {} - ThreadSafeList(const ThreadSafeList &other) { - std::lock_guard guard(other.lock); - list.assign(other.list); - } - - template - ThreadSafeList(Iter first, Iter last, const Alloc &a = Alloc()) : list(first, last, a) {} - - inline T front() const { - std::lock_guard guard(lock); - return list.front(); - } - - inline void pop_front() { - std::lock_guard guard(lock); - return list.pop_front(); - } - - inline void push_front(const T &v) { - std::lock_guard guard(lock); - return list.push_front(v); - } - - inline T back() const { - std::lock_guard guard(lock); - return list.back(); - } - - inline void pop_back() { - std::lock_guard guard(lock); - return list.pop_back(); - } - - inline void push_back(const T &v) { - std::lock_guard guard(lock); - return list.push_back(v); - } - - bool empty() const { - std::lock_guard guard(lock); - return list.empty(); - } - - inline void clear() { - std::lock_guard guard(lock); - return list.clear(); - } - - void DoState(PointerWrap &p) { - std::lock_guard guard(lock); - Do(p, list); - } - -private: - mutable std::mutex lock; - std::list list; -}; - diff --git a/UWP/CommonUWP/CommonUWP.vcxproj b/UWP/CommonUWP/CommonUWP.vcxproj index 1306601e3b..cea1639279 100644 --- a/UWP/CommonUWP/CommonUWP.vcxproj +++ b/UWP/CommonUWP/CommonUWP.vcxproj @@ -106,7 +106,6 @@ - diff --git a/UWP/CommonUWP/CommonUWP.vcxproj.filters b/UWP/CommonUWP/CommonUWP.vcxproj.filters index c6c1527a4a..75c2f7f764 100644 --- a/UWP/CommonUWP/CommonUWP.vcxproj.filters +++ b/UWP/CommonUWP/CommonUWP.vcxproj.filters @@ -901,9 +901,6 @@ Data\Collections - - Data\Collections - GPU