ladybird/Libraries/LibProtocol
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
..
Client.cpp ProtocolServer+LibWeb: Support more detailed HTTP requests 2020-09-28 11:55:26 +02:00
Client.h ProtocolServer+LibWeb: Support more detailed HTTP requests 2020-09-28 11:55:26 +02:00
CMakeLists.txt Build: Switch to CMake :^) 2020-05-14 20:15:18 +02:00
Download.cpp AK: Make RefPtr, NonnullRefPtr, WeakPtr thread safe 2020-11-10 19:11:52 +01:00
Download.h ProtocolServer+LibTLS: Pipe certificate requests from LibTLS to clients 2020-08-02 18:57:51 +02:00