1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 03:37:34 +00:00
serenity/Libraries/LibCore
Tom 75f61fe3d9 AK: Make RefPtr, NonnullRefPtr, WeakPtr thread safe
This makes most operations thread safe, especially so that they
can safely be used in the Kernel. This includes obtaining a strong
reference from a weak reference, which now requires an explicit
call to WeakPtr::strong_ref(). Another major change is that
Weakable::make_weak_ref() may require the explicit target type.
Previously we used reinterpret_cast in WeakPtr, assuming that it
can be properly converted. But WeakPtr does not necessarily have
the knowledge to be able to do this. Instead, we now ask the class
itself to deliver a WeakPtr to the type that we want.

Also, WeakLink is no longer specific to a target type. The reason
for this is that we want to be able to safely convert e.g. WeakPtr<T>
to WeakPtr<U>, and before this we just reinterpret_cast the internal
WeakLink<T> to WeakLink<U>, which is a bold assumption that it would
actually produce the correct code. Instead, WeakLink now operates
on just a raw pointer and we only make those constructors/operators
available if we can verify that it can be safely cast.

In order to guarantee thread safety, we now use the least significant
bit in the pointer for locking purposes. This also means that only
properly aligned pointers can be used.
2020-11-10 19:11:52 +01:00
..
Account.cpp LibCore: Use new format functions in some places. 2020-10-17 23:20:31 +02:00
Account.h LibCore: Add Core::Account for login management. 2020-09-21 20:18:05 +02:00
ArgsParser.cpp AK: Rename new_out to out and new_warn to warn. 2020-11-09 16:21:29 +01:00
ArgsParser.h LibCore: Add an ArgsParser::add_option() overload for doubles 2020-11-07 18:28:35 +01:00
CMakeLists.txt LibCore: Add Core::Account for login management. 2020-09-21 20:18:05 +02:00
Command.cpp LibCore: Rename File::ShouldCloseFile{Description => Descriptor} 2020-10-25 13:59:41 +01:00
Command.h LibCore: Add command() utility functions 2020-09-15 21:43:29 +02:00
ConfigFile.cpp LibCore: Use new format functions in some places. 2020-10-17 23:20:31 +02:00
ConfigFile.h LibCore: Add ConfigFile::get_for_lib() 2020-08-18 12:07:32 +02:00
DateTime.cpp LibCore: Use new format functions in some places. 2020-10-17 23:20:31 +02:00
DateTime.h LibCore: Comment that DateTime is in local time. 2020-08-20 20:53:43 +02:00
DirIterator.cpp LibCore: Use new format functions in some places. 2020-10-17 23:20:31 +02:00
DirIterator.h LibCore: Add find_executable_in_path. 2020-09-16 19:39:17 +02:00
ElapsedTimer.cpp LibCore: Expose origin timestamp of Core::ElapsedTime 2020-09-29 18:22:53 +02:00
ElapsedTimer.h LibCore: Expose origin timestamp of Core::ElapsedTime 2020-09-29 18:22:53 +02:00
Event.cpp AK: Make RefPtr, NonnullRefPtr, WeakPtr thread safe 2020-11-10 19:11:52 +01:00
Event.h AK: Make RefPtr, NonnullRefPtr, WeakPtr thread safe 2020-11-10 19:11:52 +01:00
EventLoop.cpp AK: Make RefPtr, NonnullRefPtr, WeakPtr thread safe 2020-11-10 19:11:52 +01:00
EventLoop.h LibCore: Add 'notify_forked()' to tear down the eventloop in forked child 2020-09-09 20:35:21 +02:00
File.cpp LibCore: Rename File::ShouldCloseFile{Description => Descriptor} 2020-10-25 13:59:41 +01:00
File.h LibCore: Rename File::ShouldCloseFile{Description => Descriptor} 2020-10-25 13:59:41 +01:00
FileStream.h AK: Lower the requirements for InputStream::eof and rename it. 2020-09-14 20:58:12 +02:00
Forward.h LibCore: Fix typo in Forward.h 2020-06-11 22:44:54 +02:00
GetPassword.cpp LibCore: add get_password(). 2020-07-28 17:07:22 +02:00
GetPassword.h LibCore: add get_password(). 2020-07-28 17:07:22 +02:00
Gzip.cpp LibCore: Trim decompressed Gzip output to size 2020-04-28 09:32:33 +02:00
Gzip.h Meta: Add a script check the presence of "#pragma once" in header files 2020-05-29 07:59:45 +02:00
IODevice.cpp LibCore: IODevice::can_read_line() should succeed for newline-less file 2020-10-25 14:38:07 +01:00
IODevice.h LibCore: Add Core::IODevice::truncate() 2020-09-06 16:09:26 +02:00
IODeviceStreamReader.h LibCore: Remove leading C from filenames 2020-02-06 15:04:03 +01:00
LocalServer.cpp LibCore: Prefer strlcpy over strncpy, fix overflow 2020-08-24 00:45:03 +02:00
LocalServer.h LibCore: Remove a bunch of unnecessary forward declarations 2020-02-15 00:32:33 +01:00
LocalSocket.cpp LibCore: Remove some debug spam in Local{Server,Socket} 2020-06-22 21:21:38 +02:00
LocalSocket.h LibCore: Add API for taking over an accepted socket from SystemServer 2020-06-21 21:54:30 +02:00
MimeData.cpp LibCore+WebServer+LibWeb: Make MIME type guesser take a StringView 2020-10-21 21:16:20 +02:00
MimeData.h LibGUI+WindowServer: Make DragOperation hold a MimeData instance 2020-11-08 21:46:13 +01:00
NetworkJob.cpp ProtocolServer: Implement and handle download progress 2020-05-03 12:59:26 +02:00
NetworkJob.h ProtocolServer: Implement and handle download progress 2020-05-03 12:59:26 +02:00
NetworkResponse.cpp LibCore: Remove leading C from filenames 2020-02-06 15:04:03 +01:00
NetworkResponse.h LibCore: Remove leading C from filenames 2020-02-06 15:04:03 +01:00
Notifier.cpp LibCore: Add Notifier::close 2020-09-16 17:50:43 +02:00
Notifier.h LibCore: Add Notifier::close 2020-09-16 17:50:43 +02:00
Object.cpp LibCore: Add formatter for Object. 2020-10-17 23:20:31 +02:00
Object.h LibCore: Add formatter for Object. 2020-10-17 23:20:31 +02:00
ProcessStatisticsReader.cpp Kernel/LibCore: Expose processor id where a thread last ran 2020-07-01 12:07:01 +02:00
ProcessStatisticsReader.h LibCore+top: Use pid_t for pgid/pgrp/sid numbers 2020-09-06 19:04:47 +02:00
Property.cpp LibCore: Make Core::Object properties more dynamic 2020-09-15 21:46:26 +02:00
Property.h LibCore: Make Core::Object properties more dynamic 2020-09-15 21:46:26 +02:00
puff.cpp LibCore: Rename puff.c => puff.cpp 2020-07-29 14:41:57 +02:00
puff.h Meta: Add a script check the presence of "#pragma once" in header files 2020-05-29 07:59:45 +02:00
Socket.cpp Everywhere: Port to String::copy_characters_to_buffer() 2020-08-30 17:35:27 +02:00
Socket.h LibCore: Change the signature of Socket::send() to use Span. 2020-07-27 19:58:09 +02:00
SocketAddress.cpp LibCore: Move LogStream::operator<< overloads into cpp files 2020-02-15 00:58:52 +01:00
SocketAddress.h Everywhere: Port to String::copy_characters_to_buffer() 2020-08-30 17:35:27 +02:00
StandardPaths.cpp LibCore+Base: Move user-specific config files to $HOME/.config 2020-08-05 17:40:47 +02:00
StandardPaths.h LibCore+Base: Move user-specific config files to $HOME/.config 2020-08-05 17:40:47 +02:00
SyscallUtils.h LibCore: Put safe_syscall() debug spam behind #ifdef 2020-06-22 21:19:10 +02:00
TCPServer.cpp LibCore: Make TCPServer::listen() report failure instead of asserting 2020-09-28 22:14:23 +02:00
TCPServer.h LibCore: Remove a bunch of unnecessary forward declarations 2020-02-15 00:32:33 +01:00
TCPSocket.cpp Build: Make Lagom build under macOS (#2341) 2020-05-23 15:31:30 +02:00
TCPSocket.h LibCore: Remove a bunch of unnecessary forward declarations 2020-02-15 00:32:33 +01:00
Timer.cpp LibCore: Add Timer::restart() convenience API 2020-06-11 22:35:37 +02:00
Timer.h LibCore: Add Timer::restart() convenience API 2020-06-11 22:35:37 +02:00
UDPServer.cpp Meta+LibC through LibHTTP: Make clang-format-10 clean 2020-09-25 21:18:17 +02:00
UDPServer.h LibCore: Fix UDPServer up to properly receive data 2020-04-04 12:25:33 +02:00
UDPSocket.cpp LibCore: remove redundant UDPSocket constructor 2020-08-10 20:03:18 +02:00
UDPSocket.h LibCore: remove redundant UDPSocket constructor 2020-08-10 20:03:18 +02:00