1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-08 23:17:35 +00:00

Kernel: Remove unused FIFO::all_fifos() table

This commit is contained in:
Andreas Kling 2021-08-15 16:48:10 +02:00
parent 6a20733fcd
commit cda69704dc

View file

@ -5,25 +5,15 @@
*/
#include <AK/Atomic.h>
#include <AK/HashTable.h>
#include <AK/Singleton.h>
#include <AK/StdLibExtras.h>
#include <Kernel/FileSystem/FIFO.h>
#include <Kernel/FileSystem/FileDescription.h>
#include <Kernel/Locking/Mutex.h>
#include <Kernel/Locking/ProtectedValue.h>
#include <Kernel/Process.h>
#include <Kernel/Thread.h>
namespace Kernel {
static Singleton<ProtectedValue<HashTable<FIFO*>>> s_table;
static ProtectedValue<HashTable<FIFO*>>& all_fifos()
{
return *s_table;
}
static Atomic<int> s_next_fifo_id = 1;
RefPtr<FIFO> FIFO::try_create(uid_t uid)
@ -79,9 +69,6 @@ FIFO::FIFO(uid_t uid, NonnullOwnPtr<DoubleBuffer> buffer)
: m_buffer(move(buffer))
, m_uid(uid)
{
all_fifos().with_exclusive([&](auto& table) {
table.set(this);
});
m_fifo_id = ++s_next_fifo_id;
// Use the same block condition for read and write
@ -92,9 +79,6 @@ FIFO::FIFO(uid_t uid, NonnullOwnPtr<DoubleBuffer> buffer)
FIFO::~FIFO()
{
all_fifos().with_exclusive([&](auto& table) {
table.remove(this);
});
}
void FIFO::attach(Direction direction)