mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Remove ThreadSafeList
Its one user was sceGe's pending interrupt list, which is only touched from the emulator thread. Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
1 parent
8a23e633a1
commit
33c01a3fc1
6 files changed
-94
No files matched your search
@@ -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
|
||||
|
||||
@@ -391,7 +391,6 @@
|
||||
<ClInclude Include="Data\Collections\Hashmaps.h" />
|
||||
<ClInclude Include="Data\Collections\LinkedList.h" />
|
||||
<ClInclude Include="Data\Collections\Slice.h" />
|
||||
<ClInclude Include="Data\Collections\ThreadSafeList.h" />
|
||||
<ClInclude Include="Data\Collections\TinySet.h" />
|
||||
<ClInclude Include="Data\Color\RGBAUtil.h" />
|
||||
<ClInclude Include="Data\Convert\SmallDataConvert.h" />
|
||||
|
||||
@@ -338,9 +338,6 @@
|
||||
<ClInclude Include="Data\Collections\Hashmaps.h">
|
||||
<Filter>Data\Collections</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Data\Collections\ThreadSafeList.h">
|
||||
<Filter>Data\Collections</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="GPU\Shader.h">
|
||||
<Filter>GPU</Filter>
|
||||
</ClInclude>
|
||||
|
||||
@@ -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 <list>
|
||||
|
||||
template < typename T, class Alloc = std::allocator<T> >
|
||||
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<T, Alloc> &other) : list(other) {}
|
||||
ThreadSafeList(const ThreadSafeList &other) {
|
||||
std::lock_guard<std::mutex> guard(other.lock);
|
||||
list.assign(other.list);
|
||||
}
|
||||
|
||||
template <class Iter>
|
||||
ThreadSafeList(Iter first, Iter last, const Alloc &a = Alloc()) : list(first, last, a) {}
|
||||
|
||||
inline T front() const {
|
||||
std::lock_guard<std::mutex> guard(lock);
|
||||
return list.front();
|
||||
}
|
||||
|
||||
inline void pop_front() {
|
||||
std::lock_guard<std::mutex> guard(lock);
|
||||
return list.pop_front();
|
||||
}
|
||||
|
||||
inline void push_front(const T &v) {
|
||||
std::lock_guard<std::mutex> guard(lock);
|
||||
return list.push_front(v);
|
||||
}
|
||||
|
||||
inline T back() const {
|
||||
std::lock_guard<std::mutex> guard(lock);
|
||||
return list.back();
|
||||
}
|
||||
|
||||
inline void pop_back() {
|
||||
std::lock_guard<std::mutex> guard(lock);
|
||||
return list.pop_back();
|
||||
}
|
||||
|
||||
inline void push_back(const T &v) {
|
||||
std::lock_guard<std::mutex> guard(lock);
|
||||
return list.push_back(v);
|
||||
}
|
||||
|
||||
bool empty() const {
|
||||
std::lock_guard<std::mutex> guard(lock);
|
||||
return list.empty();
|
||||
}
|
||||
|
||||
inline void clear() {
|
||||
std::lock_guard<std::mutex> guard(lock);
|
||||
return list.clear();
|
||||
}
|
||||
|
||||
void DoState(PointerWrap &p) {
|
||||
std::lock_guard<std::mutex> guard(lock);
|
||||
Do(p, list);
|
||||
}
|
||||
|
||||
private:
|
||||
mutable std::mutex lock;
|
||||
std::list<T, Alloc> list;
|
||||
};
|
||||
|
||||
@@ -106,7 +106,6 @@
|
||||
<ClInclude Include="..\..\Common\Data\Collections\ConstMap.h" />
|
||||
<ClInclude Include="..\..\Common\Data\Collections\FixedSizeQueue.h" />
|
||||
<ClInclude Include="..\..\Common\Data\Collections\Hashmaps.h" />
|
||||
<ClInclude Include="..\..\Common\Data\Collections\ThreadSafeList.h" />
|
||||
<ClInclude Include="..\..\Common\Data\Collections\TinySet.h" />
|
||||
<ClInclude Include="..\..\Common\Data\Collections\CyclicBuffer.h" />
|
||||
<ClInclude Include="..\..\Common\Data\Color\RGBAUtil.h" />
|
||||
|
||||
@@ -901,9 +901,6 @@
|
||||
<ClInclude Include="..\..\Common\Data\Collections\Hashmaps.h">
|
||||
<Filter>Data\Collections</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\Common\Data\Collections\ThreadSafeList.h">
|
||||
<Filter>Data\Collections</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\Common\GPU\Shader.h">
|
||||
<Filter>GPU</Filter>
|
||||
</ClInclude>
|
||||
|
||||
Reference in new issue
Block a user