From ee7ad8a8996cd48eb3bb4604732096572d006712 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Tue, 29 Sep 2026 10:42:43 +0200 Subject: kstd/concepts: document basic_lockable --- libs/kstd/kstd/bits/concepts.hpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'libs/kstd') 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 && std::convertible_to, 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 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(); }; -- cgit v1.2.3