Kernel: Assign Lock names in class member initializers.

This commit is contained in:
Andreas Kling 2019-05-02 03:28:20 +02:00
parent 2dc72bb297
commit c3b7ace3e0
12 changed files with 11 additions and 18 deletions

View file

@ -40,7 +40,6 @@ Retained<IDEDiskDevice> IDEDiskDevice::create()
IDEDiskDevice::IDEDiskDevice()
: IRQHandler(IRQ_FIXED_DISK)
, m_lock("IDEDiskDevice")
{
initialize();
}

View file

@ -30,7 +30,7 @@ private:
bool read_sectors(dword start_sector, word count, byte* buffer);
bool write_sectors(dword start_sector, word count, const byte* data);
Lock m_lock;
Lock m_lock { "IDEDiskDevice" };
word m_cylinders { 0 };
word m_heads { 0 };
word m_sectors_per_track { 0 };

View file

@ -9,7 +9,6 @@ public:
DoubleBuffer()
: m_write_buffer(&m_buffer1)
, m_read_buffer(&m_buffer2)
, m_lock("DoubleBuffer")
{
}
@ -31,5 +30,5 @@ private:
Vector<byte> m_buffer2;
ssize_t m_read_buffer_index { 0 };
bool m_empty { true };
Lock m_lock;
Lock m_lock { "DoubleBuffer" };
};

View file

@ -25,8 +25,7 @@ HashTable<Inode*>& all_inodes()
}
FS::FS()
: m_lock("FS")
, m_fsid(++s_lastFileSystemID)
: m_fsid(++s_lastFileSystemID)
{
all_fses().set(m_fsid, this);
}
@ -87,8 +86,7 @@ FS::DirectoryEntry::DirectoryEntry(const char* n, int nl, InodeIdentifier i, byt
}
Inode::Inode(FS& fs, unsigned index)
: m_lock("Inode")
, m_fs(fs)
: m_fs(fs)
, m_index(index)
{
all_inodes().set(this);

View file

@ -62,7 +62,7 @@ public:
protected:
FS();
mutable Lock m_lock;
mutable Lock m_lock { "FS" };
private:
unsigned m_fsid { 0 };
@ -133,7 +133,7 @@ protected:
void inode_contents_changed(off_t, ssize_t, const byte*);
void inode_size_changed(size_t old_size, size_t new_size);
mutable Lock m_lock;
mutable Lock m_lock { "Inode" };
private:
FS& m_fs;

View file

@ -19,8 +19,7 @@ KResultOr<Retained<Socket>> Socket::create(int domain, int type, int protocol)
}
Socket::Socket(int domain, int type, int protocol)
: m_lock("Socket")
, m_domain(domain)
: m_domain(domain)
, m_type(type)
, m_protocol(protocol)
{

View file

@ -60,7 +60,7 @@ protected:
void load_send_deadline();
private:
Lock m_lock;
Lock m_lock { "Socket" };
pid_t m_origin_pid { 0 };
int m_domain { 0 };
int m_type { 0 };

View file

@ -549,7 +549,6 @@ Process::Process(String&& name, uid_t uid, gid_t gid, pid_t ppid, RingLevel ring
, m_executable(move(executable))
, m_tty(tty)
, m_ppid(ppid)
, m_big_lock("Big Process Lock")
{
dbgprintf("Process: New process PID=%u with name=%s\n", m_pid, m_name.characters());

View file

@ -326,7 +326,7 @@ private:
RetainPtr<ProcessTracer> m_tracer;
Lock m_big_lock;
Lock m_big_lock { "Process" };
};
class ProcessInspectionHandle {

View file

@ -17,7 +17,6 @@ PTYMultiplexer& PTYMultiplexer::the()
PTYMultiplexer::PTYMultiplexer()
: CharacterDevice(5, 2)
, m_lock("PTYMultiplexer")
{
s_the = this;
m_freelist.ensure_capacity(s_max_pty_pairs);

View file

@ -27,6 +27,6 @@ private:
// ^CharacterDevice
virtual const char* class_name() const override { return "PTYMultiplexer"; }
Lock m_lock;
Lock m_lock { "PTYMultiplexer" };
Vector<unsigned> m_freelist;
};

View file

@ -55,5 +55,5 @@ private:
bool m_allow_cpu_caching { true };
RetainPtr<Inode> m_inode;
Vector<RetainPtr<PhysicalPage>> m_physical_pages;
Lock m_paging_lock;
Lock m_paging_lock { "VMObject" };
};