ladybird/Userland/Libraries/LibPthread
kleines Filmröllchen 2f50d8f4d3 AK+LibC+LibPthread: Introduce NoAllocationGuard
NoAllocationGuard is an RAII stack guard that prevents allocations
while it exists. This is done through a thread-local global flag which
causes malloc to crash on a VERIFY if it is false. The guard allows for
recursion.

The intended use case for this class is in real-time audio code. In such
code, allocations are really bad, and this is an easy way of dynamically
enforcing the no-allocations rule while giving the user good feedback if
it is violated. Before real-time audio code is executed, e.g. in LibDSP,
a NoAllocationGuard is instantiated. This is not done with this commit,
as currently some code in LibDSP may still incorrectly allocate in real-
time situations.

Other use cases for the Kernel have also been added, so this commit
builds on the previous to add the support both in Userland and in the
Kernel.
2022-01-11 00:08:58 +01:00
..
CMakeLists.txt LibPthread: Reimplement condition variables 2021-07-05 20:26:01 +02:00
forward.cpp Revert "Userland: static vs non-static constexpr variables" 2021-05-21 10:30:52 +01:00
pthread_cond.cpp LibPthread: Validate the clock argument in pthread_condattr_setclock 2022-01-09 11:15:06 +03:30
pthread_once.cpp LibPthread: Add POSIX spec links for pthread_once API 2022-01-07 01:18:57 -08:00
pthread.cpp AK+LibC+LibPthread: Introduce NoAllocationGuard 2022-01-11 00:08:58 +01:00
pthread.h LibPthread: Implement pthread_condattr_getclock 2022-01-09 11:15:06 +03:30
semaphore.cpp LibPthread: Add POSIX spec links for semaphore APIs 2022-01-07 01:18:57 -08:00
semaphore.h LibPthread: Reimplement semaphores 2021-07-05 20:26:01 +02:00