diff options
| author | Felix Morgner <felix.morgner@ost.ch> | 2026-09-29 10:42:43 +0200 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@ost.ch> | 2026-09-29 10:42:43 +0200 |
| commit | ee7ad8a8996cd48eb3bb4604732096572d006712 (patch) | |
| tree | 0daf19bd21f24623987eaf17bbf65286e5ddef6b | |
| parent | e9b880648c18d3680ae10cc5660f0dbe981af5d8 (diff) | |
| download | kernel-ee7ad8a8996cd48eb3bb4604732096572d006712.tar.xz kernel-ee7ad8a8996cd48eb3bb4604732096572d006712.zip | |
kstd/concepts: document basic_lockable
| -rw-r--r-- | libs/kstd/kstd/bits/concepts.hpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libs/kstd/kstd/bits/concepts.hpp b/libs/kstd/kstd/bits/concepts.hpp index 3e89caa9..af9f6d2c 100644 --- a/libs/kstd/kstd/bits/concepts.hpp +++ b/libs/kstd/kstd/bits/concepts.hpp @@ -11,9 +11,21 @@ namespace kstd::bits concept container_compatible_range = std::ranges::input_range<RangeType> && std::convertible_to<std::ranges::range_reference_t<RangeType>, ValueType>; + //! Requirements on a basic lockable object. + //! + //! Given: + //! - @p L, a class type + //! - @p l, an instance of @p L + //! + //! @p L is said to be **lockable**, iff. the following expressions are valid: + //! - @p l.lock(); + //! - @p l.unlock(); template<typename LockableType> concept basic_lockable = requires(LockableType & lockable) { + //! Lock the lockable object, blocking until the lock has been acquired. lockable.lock(); + + //! Unlock the lockable object. lockable.unlock(); }; |
