Commit graph

9 commits

Author SHA1 Message Date
circl c169e43e13 Userland: Remove some SerenityOS checks 2024-06-10 13:53:01 +02:00
Ben Wiederhake 6fd478b6ce Everywhere: Remove unused includes of AK/Format.h
These instances were detected by searching for files that include
AK/Format.h, but don't match the regex:

\\b(CheckedFormatString|critical_dmesgln|dbgln|dbgln_if|dmesgln|FormatBu
ilder|__FormatIfSupported|FormatIfSupported|FormatParser|FormatString|Fo
rmattable|Formatter|__format_value|HasFormatter|max_format_arguments|out
|outln|set_debug_enabled|StandardFormatter|TypeErasedFormatParams|TypeEr
asedParameter|VariadicFormatParams|v_critical_dmesgln|vdbgln|vdmesgln|vf
ormat|vout|warn|warnln|warnln_if)\\b

(Without the linebreaks.)

This regex is pessimistic, so there might be more files that don't
actually use any formatting functions.

Observe that this revealed that Userland/Libraries/LibC/signal.cpp is
missing an include.

In theory, one might use LibCPP to detect things like this
automatically, but let's do this one step after another.
2023-01-02 20:27:20 -05:00
Andrew Kaster 828441852f Everywhere: Replace uses of __serenity__ with AK_OS_SERENITY
Now that we have OS macros for essentially every supported OS, let's try
to use them everywhere.
2022-10-10 12:23:12 +02:00
kleines Filmröllchen 3d6e08156d LibThreading: Introduce MutexProtected generic synchronization primitive
MutexProtected mirrors the identically-named Kernel primitive and can be
used to synchronize access to any object that might not be thread safe
on its own. Synchronization is done with a simple mutex, so access to a
MutexProtected object is potentially blocking.

Mutex now has an internal nesting variable which is there to harden it
against lock-unlock ordering issues (e.g. double unlocking).
2022-01-23 15:21:10 +01:00
Ben Wiederhake d9a0d2182d LibThreading: Add missing headers to Mutex.h 2021-10-06 23:52:40 +01:00
Brian Gianforcaro 744de5ec69 LibThreading: Use default instead of an empty constructor/destructor
Default implementations allow for more optimizations.
See: https://pvs-studio.com/en/docs/warnings/v832/
2021-09-16 17:17:13 +02:00
Brian Gianforcaro bff33c67ab LibThreading: Neither Mutex or MutexLocker should be movable / copyable 2021-09-16 17:17:13 +02:00
kleines Filmröllchen c7104e7512 LibThreading: Add ConditionVariable wrapper
ConditionVariable is a thin wrapper over the pthread_cond_* APIs, just
as Mutex is a wrapper over pthread_mutex.

Because ConditionVariable might want to wait on a high-level Mutex, it
needs to be friends with it.
2021-09-12 23:38:57 +02:00
Andreas Kling b8a204c5b9 LibThreading: Rename Lock => Mutex 2021-07-09 11:15:50 +02:00
Renamed from Userland/Libraries/LibThreading/Lock.h (Browse further)