Skip to content

Commit

Permalink
[clang-tidy][DOC] Fix syntax in coroutine-hostile-raii.rst
Browse files Browse the repository at this point in the history
Fix ':4:Title underline too short.'
  • Loading branch information
PiotrZSL committed Oct 18, 2023
1 parent ecd3934 commit 1891d21
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
.. title:: clang-tidy - misc-coroutine-hostile-raii

misc-coroutine-hostile-raii
====================
===========================

Detects when objects of certain hostile RAII types persists across suspension
points in a coroutine. Such hostile types include scoped-lockable types and
types belonging to a configurable denylist.

Some objects require that they be destroyed on the same thread that created them.
Some objects require that they be destroyed on the same thread that created them.
Traditionally this requirement was often phrased as "must be a local variable",
under the assumption that local variables always work this way. However this is
incorrect with C++20 coroutines, since an intervening ``co_await`` may cause the
coroutine to suspend and later be resumed on another thread.

The lifetime of an object that requires being destroyed on the same thread must
The lifetime of an object that requires being destroyed on the same thread must
not encompass a ``co_await`` or ``co_yield`` point. If you create/destroy an object,
you must do so without allowing the coroutine to suspend in the meantime.

Following types are considered as hostile:

- Scoped-lockable types: A scoped-lockable object persisting across a suspension
point is problematic as the lock held by this object could be unlocked by a
point is problematic as the lock held by this object could be unlocked by a
different thread. This would be undefined behaviour.
This includes all types annotated with the ``scoped_lockable`` attribute.

Expand All @@ -44,7 +44,7 @@ Options

.. option:: RAIITypesList

A semicolon-separated list of qualified types which should not be allowed to
A semicolon-separated list of qualified types which should not be allowed to
persist across suspension points.
Eg: ``my::lockable; a::b;::my::other::lockable;``
The default value of this option is `"std::lock_guard;std::scoped_lock"`.
The default value of this option is `"std::lock_guard;std::scoped_lock"`.

0 comments on commit 1891d21

Please sign in to comment.