class synchronization_checker

Defined at line 79 of file ../../sdk/lib/async/include/lib/async/cpp/sequence_checker.h

A generalized |sequence_checker| that checks for synchronized access:

- If the underlying asynchronous runtime supports sequences, performs the

same checks as |sequence_checker|.

- If the underlying asynchronous runtime does not support sequences, performs

the same checks as a thread checker.

This class is useful for code that must work with many asynchronous runtimes.

Public Methods

void synchronization_checker (async_dispatcher_t * dispatcher, const char * application_description)

Constructs a synchronization checker bound to the currently running

sequence. If |dispatcher| does not support sequences, fallback to thread

ID.

If |application_description| is not null, it will be prepended in front of

synchronization check failure panic messages. For example, one may specify

"|Foo| is thread unsafe." so that users understand whose threading

invariants did they violate.

Defined at line 48 of file ../../sdk/lib/async/sequence_checker.cc

std::variant<std::monostate, std::string> is_synchronized ()

Returns |monostate| if synchronized access is guaranteed and a |string|

describing the error otherwise.

Defined at line 67 of file ../../sdk/lib/async/sequence_checker.cc

void lock ()

Implementation of the BaseLockable requirement

Defined at line 85 of file ../../sdk/lib/async/sequence_checker.cc

void ~synchronization_checker ()

Defined at line 92 of file ../../sdk/lib/async/include/lib/async/cpp/sequence_checker.h

void unlock ()

Defined at line 101 of file ../../sdk/lib/async/include/lib/async/cpp/sequence_checker.h